Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 74.5% → 83.8%
Time: 8.5s
Alternatives: 21
Speedup: 0.5×

Specification

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

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

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

\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\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: 74.5% accurate, 1.0× speedup?

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

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

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

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

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

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

    1. Initial program 87.4%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.7% accurate, 0.5× speedup?

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

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

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

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-a, t \cdot x, \left(-b\right) \cdot \mathsf{fma}\left(-a, i, c \cdot z\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
      19. lift-*.f6480.2

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.5500000000000001e144 or 7.9999999999999997e35 < y

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.5500000000000001e144 < y < 6.2000000000000002e-45

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000002e-45 < y < 7.9999999999999997e35

    1. Initial program 70.3%

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

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

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

Alternative 4: 66.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.4e147 or 7.9999999999999997e35 < y

    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e147 < y < 4.99999999999999976e-45

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999976e-45 < y < 7.9999999999999997e35

    1. Initial program 70.3%

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

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

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

Alternative 5: 66.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, i, c \cdot z\right)\\
t_2 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot t\right) \cdot c\right) - t\_1 \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.4e147 or 7.9999999999999997e35 < y

    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e147 < y < 3.20000000000000007e-45

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000007e-45 < y < 7.9999999999999997e35

    1. Initial program 70.3%

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

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

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

Alternative 6: 68.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.75 \cdot 10^{+44} \lor \neg \left(j \leq 5.4 \cdot 10^{+216}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -1.75e44 or 5.4000000000000003e216 < j

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6472.1

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

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

    if -1.75e44 < j < 5.4000000000000003e216

    1. Initial program 66.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\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 - a \cdot i\right)\right) \]
    5. Applied rewrites67.0%

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

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

Alternative 7: 51.6% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.2999999999999999e25 or 1.02000000000000002e101 < a

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \]
      8. lower-neg.f6470.0

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

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

    if -1.2999999999999999e25 < a < 4.7999999999999998e-81

    1. Initial program 75.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j, t, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      6. lower-neg.f6453.2

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

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

    if 4.7999999999999998e-81 < a < 1.02000000000000002e101

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+25}:\\ \;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-81}:\\ \;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{+101}:\\ \;\;\;\;\mathsf{fma}\left(-a, t \cdot x, b \cdot \left(\left(-c\right) \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.2 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(-i, j \cdot y, \left(z \cdot y\right) \cdot x + a \cdot \left(i \cdot b\right)\right)\\

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

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


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

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, j \cdot y, \left(z \cdot y\right) \cdot x - \left(-a\right) \cdot \left(i \cdot b\right)\right) \]
      4. lift-*.f6473.7

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

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

    if -5.2e16 < i < 7.49999999999999983e100

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-b, z, j \cdot t\right), c, \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x\right) \]
      18. lift-neg.f6462.2

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

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

    if 7.49999999999999983e100 < i

    1. Initial program 55.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \]
      12. lower-neg.f6461.9

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

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

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

Alternative 9: 58.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1e120 or 1.85e52 < y

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites68.9%

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

    if -2.1e120 < y < 1.8999999999999999e-105

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-b, z, j \cdot t\right), c, \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x\right) \]
      18. lift-neg.f6465.2

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

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

    if 1.8999999999999999e-105 < y < 1.85e52

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6459.6

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

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

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

Alternative 10: 29.1% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -4.2e62 or 1.50000000000000011e37 < b

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6467.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \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.f6442.6

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

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

    if -4.2e62 < b < -8.8999999999999998e-72

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6441.0

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

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

      \[\leadsto \left(-1 \cdot \left(i \cdot y\right)\right) \cdot j \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i \cdot y\right)\right) \cdot j \]
      2. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. lift-neg.f6434.6

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

      \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]

    if -8.8999999999999998e-72 < b < -2.90000000000000019e-186

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6463.1

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6449.1

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    8. Applied rewrites49.1%

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

    if -2.90000000000000019e-186 < b < -1.5e-286

    1. Initial program 72.4%

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites57.1%

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

    if -1.5e-286 < b < 1.50000000000000011e37

    1. Initial program 59.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{+62}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;b \leq -8.9 \cdot 10^{-72}:\\ \;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\ \mathbf{elif}\;b \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{elif}\;b \leq -1.5 \cdot 10^{-286}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+37}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 28.6% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;b \leq -6.8 \cdot 10^{-52}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -3.40000000000000004e88 or 1.50000000000000011e37 < b

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6467.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \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.f6444.0

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

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

    if -3.40000000000000004e88 < b < -6.80000000000000035e-52

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6439.3

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6433.1

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

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

    if -6.80000000000000035e-52 < b < -2.90000000000000019e-186

    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6460.5

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6442.6

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

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

    if -2.90000000000000019e-186 < b < -1.5e-286

    1. Initial program 72.4%

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites57.1%

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

    if -1.5e-286 < b < 1.50000000000000011e37

    1. Initial program 59.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.4 \cdot 10^{+88}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;b \leq -6.8 \cdot 10^{-52}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;b \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{elif}\;b \leq -1.5 \cdot 10^{-286}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+37}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 28.8% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;b \leq -6.8 \cdot 10^{-52}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -3.40000000000000004e88 or 1.50000000000000011e37 < b

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6467.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \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.f6444.0

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

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

    if -3.40000000000000004e88 < b < -6.80000000000000035e-52

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6439.3

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6433.1

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

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

    if -6.80000000000000035e-52 < b < -2.90000000000000019e-186

    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6460.5

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6442.6

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

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

    if -2.90000000000000019e-186 < b < 4.2e-276

    1. Initial program 64.9%

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

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

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

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

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

    if 4.2e-276 < b < 1.50000000000000011e37

    1. Initial program 61.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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 -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.4 \cdot 10^{+88}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;b \leq -6.8 \cdot 10^{-52}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;b \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-276}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+37}:\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 42.2% accurate, 1.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.10000000000000009e-47 or 5.60000000000000001e-71 < b

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6457.7

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites57.7%

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

    if -1.10000000000000009e-47 < b < -2.90000000000000019e-186

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6458.3

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6441.2

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    8. Applied rewrites41.2%

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

    if -2.90000000000000019e-186 < b < -1.5e-286

    1. Initial program 72.4%

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites57.1%

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

    if -1.5e-286 < b < 5.60000000000000001e-71

    1. Initial program 55.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-47}:\\ \;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;b \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{elif}\;b \leq -1.5 \cdot 10^{-286}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-71}:\\ \;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 29.7% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-81}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+113} \lor \neg \left(a \leq 1.8 \cdot 10^{+173}\right):\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot a\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= a -1.9e+72)
   (* (* b a) i)
   (if (<= a 4.8e-81)
     (* (* j t) c)
     (if (or (<= a 1.15e+113) (not (<= a 1.8e+173)))
       (* (- a) (* t x))
       (* (* i a) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -1.9e+72) {
		tmp = (b * a) * i;
	} else if (a <= 4.8e-81) {
		tmp = (j * t) * c;
	} else if ((a <= 1.15e+113) || !(a <= 1.8e+173)) {
		tmp = -a * (t * x);
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (a <= (-1.9d+72)) then
        tmp = (b * a) * i
    else if (a <= 4.8d-81) then
        tmp = (j * t) * c
    else if ((a <= 1.15d+113) .or. (.not. (a <= 1.8d+173))) then
        tmp = -a * (t * x)
    else
        tmp = (i * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -1.9e+72) {
		tmp = (b * a) * i;
	} else if (a <= 4.8e-81) {
		tmp = (j * t) * c;
	} else if ((a <= 1.15e+113) || !(a <= 1.8e+173)) {
		tmp = -a * (t * x);
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if a <= -1.9e+72:
		tmp = (b * a) * i
	elif a <= 4.8e-81:
		tmp = (j * t) * c
	elif (a <= 1.15e+113) or not (a <= 1.8e+173):
		tmp = -a * (t * x)
	else:
		tmp = (i * a) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (a <= -1.9e+72)
		tmp = Float64(Float64(b * a) * i);
	elseif (a <= 4.8e-81)
		tmp = Float64(Float64(j * t) * c);
	elseif ((a <= 1.15e+113) || !(a <= 1.8e+173))
		tmp = Float64(Float64(-a) * Float64(t * x));
	else
		tmp = Float64(Float64(i * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (a <= -1.9e+72)
		tmp = (b * a) * i;
	elseif (a <= 4.8e-81)
		tmp = (j * t) * c;
	elseif ((a <= 1.15e+113) || ~((a <= 1.8e+173)))
		tmp = -a * (t * x);
	else
		tmp = (i * a) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -1.9e+72], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[a, 4.8e-81], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], If[Or[LessEqual[a, 1.15e+113], N[Not[LessEqual[a, 1.8e+173]], $MachinePrecision]], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\

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

\mathbf{elif}\;a \leq 1.15 \cdot 10^{+113} \lor \neg \left(a \leq 1.8 \cdot 10^{+173}\right):\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.90000000000000003e72

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6446.7

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

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

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

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

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

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6438.2

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

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

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

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

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

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

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

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

        \[\leadsto \left(b \cdot a\right) \cdot i \]
      8. lower-*.f6444.8

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

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

    if -1.90000000000000003e72 < a < 4.7999999999999998e-81

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6430.7

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    8. Applied rewrites30.7%

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

    if 4.7999999999999998e-81 < a < 1.14999999999999998e113 or 1.8000000000000001e173 < a

    1. Initial program 65.6%

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

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

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

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

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

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

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

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6442.7

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

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

    if 1.14999999999999998e113 < a < 1.8000000000000001e173

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6475.0

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

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

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

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      2. lower-*.f6466.6

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

      \[\leadsto \left(i \cdot a\right) \cdot b \]
  3. Recombined 4 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-81}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+113} \lor \neg \left(a \leq 1.8 \cdot 10^{+173}\right):\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot a\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 51.4% accurate, 1.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -0.0100000000000000002 or 4.49999999999999962e37 < b

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6464.9

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

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

    if -0.0100000000000000002 < b < -9.19999999999999968e-190

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    6. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

        \[\leadsto \left(j \cdot c + -1 \cdot \left(a \cdot x\right)\right) \cdot t \]
      7. lower-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, c, \left(\mathsf{neg}\left(a\right)\right) \cdot x\right) \cdot t \]
      11. lift-neg.f6452.6

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

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

    if -9.19999999999999968e-190 < b < 4.49999999999999962e37

    1. Initial program 62.9%

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

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

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

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

Alternative 16: 51.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+25} \lor \neg \left(a \leq 4.8 \cdot 10^{-81}\right):\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2999999999999999e25 or 4.7999999999999998e-81 < a

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.2999999999999999e25 < a < 4.7999999999999998e-81

    1. Initial program 75.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j, t, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      6. lower-neg.f6453.2

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

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

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

Alternative 17: 52.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.01 \lor \neg \left(b \leq 4.5 \cdot 10^{+37}\right):\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -0.0100000000000000002 or 4.49999999999999962e37 < b

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6464.9

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

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

    if -0.0100000000000000002 < b < 4.49999999999999962e37

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t} \]
    6. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

        \[\leadsto \left(j \cdot c + -1 \cdot \left(a \cdot x\right)\right) \cdot t \]
      7. lower-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, c, \left(\mathsf{neg}\left(a\right)\right) \cdot x\right) \cdot t \]
      11. lift-neg.f6449.0

        \[\leadsto \mathsf{fma}\left(j, c, \left(-a\right) \cdot x\right) \cdot t \]
    7. Applied rewrites49.0%

      \[\leadsto \mathsf{fma}\left(j, c, \left(-a\right) \cdot x\right) \cdot t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.01 \lor \neg \left(b \leq 4.5 \cdot 10^{+37}\right):\\ \;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j, c, \left(-a\right) \cdot x\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 29.3% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot y\right) \cdot x\\ \mathbf{if}\;x \leq -0.034:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-152}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;x \leq 680000:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* z y) x)))
   (if (<= x -0.034)
     t_1
     (if (<= x 1.1e-152)
       (* (* i b) a)
       (if (<= x 680000.0) (* (* j t) c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (z * y) * x;
	double tmp;
	if (x <= -0.034) {
		tmp = t_1;
	} else if (x <= 1.1e-152) {
		tmp = (i * b) * a;
	} else if (x <= 680000.0) {
		tmp = (j * t) * c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z * y) * x
    if (x <= (-0.034d0)) then
        tmp = t_1
    else if (x <= 1.1d-152) then
        tmp = (i * b) * a
    else if (x <= 680000.0d0) then
        tmp = (j * t) * c
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (z * y) * x;
	double tmp;
	if (x <= -0.034) {
		tmp = t_1;
	} else if (x <= 1.1e-152) {
		tmp = (i * b) * a;
	} else if (x <= 680000.0) {
		tmp = (j * t) * c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (z * y) * x
	tmp = 0
	if x <= -0.034:
		tmp = t_1
	elif x <= 1.1e-152:
		tmp = (i * b) * a
	elif x <= 680000.0:
		tmp = (j * t) * c
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(z * y) * x)
	tmp = 0.0
	if (x <= -0.034)
		tmp = t_1;
	elseif (x <= 1.1e-152)
		tmp = Float64(Float64(i * b) * a);
	elseif (x <= 680000.0)
		tmp = Float64(Float64(j * t) * c);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (z * y) * x;
	tmp = 0.0;
	if (x <= -0.034)
		tmp = t_1;
	elseif (x <= 1.1e-152)
		tmp = (i * b) * a;
	elseif (x <= 680000.0)
		tmp = (j * t) * c;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -0.034], t$95$1, If[LessEqual[x, 1.1e-152], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[x, 680000.0], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;x \leq -0.034:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-152}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{elif}\;x \leq 680000:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.034000000000000002 or 6.8e5 < x

    1. Initial program 68.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. 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-*.f6458.8

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites58.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-*.f6435.2

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites35.2%

      \[\leadsto \left(z \cdot y\right) \cdot x \]

    if -0.034000000000000002 < x < 1.09999999999999992e-152

    1. Initial program 68.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6452.9

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites52.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6437.1

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    8. Applied rewrites37.1%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]

    if 1.09999999999999992e-152 < x < 6.8e5

    1. Initial program 69.0%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
      2. lower-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6452.6

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites52.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j} \]
    6. Taylor expanded in y around 0

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6435.8

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    8. Applied rewrites35.8%

      \[\leadsto \left(j \cdot t\right) \cdot \color{blue}{c} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.034:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-152}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;x \leq 680000:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 30.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{-10}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot a\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= a -1.9e+72)
   (* (* b a) i)
   (if (<= a 7.9e-10) (* (* j t) c) (* (* i a) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -1.9e+72) {
		tmp = (b * a) * i;
	} else if (a <= 7.9e-10) {
		tmp = (j * t) * c;
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (a <= (-1.9d+72)) then
        tmp = (b * a) * i
    else if (a <= 7.9d-10) then
        tmp = (j * t) * c
    else
        tmp = (i * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -1.9e+72) {
		tmp = (b * a) * i;
	} else if (a <= 7.9e-10) {
		tmp = (j * t) * c;
	} else {
		tmp = (i * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if a <= -1.9e+72:
		tmp = (b * a) * i
	elif a <= 7.9e-10:
		tmp = (j * t) * c
	else:
		tmp = (i * a) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (a <= -1.9e+72)
		tmp = Float64(Float64(b * a) * i);
	elseif (a <= 7.9e-10)
		tmp = Float64(Float64(j * t) * c);
	else
		tmp = Float64(Float64(i * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (a <= -1.9e+72)
		tmp = (b * a) * i;
	elseif (a <= 7.9e-10)
		tmp = (j * t) * c;
	else
		tmp = (i * a) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -1.9e+72], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[a, 7.9e-10], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\

\mathbf{elif}\;a \leq 7.9 \cdot 10^{-10}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\

\mathbf{else}:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.90000000000000003e72

    1. Initial program 57.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6446.7

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites46.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6438.2

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    8. Applied rewrites38.2%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      2. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(a \cdot b\right) \cdot i \]
      6. lower-*.f64N/A

        \[\leadsto \left(a \cdot b\right) \cdot i \]
      7. *-commutativeN/A

        \[\leadsto \left(b \cdot a\right) \cdot i \]
      8. lower-*.f6444.8

        \[\leadsto \left(b \cdot a\right) \cdot i \]
    10. Applied rewrites44.8%

      \[\leadsto \left(b \cdot a\right) \cdot i \]

    if -1.90000000000000003e72 < a < 7.8999999999999996e-10

    1. Initial program 75.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
      2. lower-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6445.1

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites45.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j} \]
    6. Taylor expanded in y around 0

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6428.4

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    8. Applied rewrites28.4%

      \[\leadsto \left(j \cdot t\right) \cdot \color{blue}{c} \]

    if 7.8999999999999996e-10 < a

    1. Initial program 65.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6448.7

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites48.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto \left(a \cdot i\right) \cdot b \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot a\right) \cdot b \]
      2. lower-*.f6433.9

        \[\leadsto \left(i \cdot a\right) \cdot b \]
    8. Applied rewrites33.9%

      \[\leadsto \left(i \cdot a\right) \cdot b \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{-10}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot a\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 29.8% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{-10}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= a -1.9e+72)
   (* (* b a) i)
   (if (<= a 7.9e-10) (* (* j t) c) (* (* i b) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (a <= -1.9e+72) {
		tmp = (b * a) * i;
	} else if (a <= 7.9e-10) {
		tmp = (j * t) * c;
	} else {
		tmp = (i * b) * 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 (a <= (-1.9d+72)) then
        tmp = (b * a) * i
    else if (a <= 7.9d-10) then
        tmp = (j * t) * c
    else
        tmp = (i * b) * 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 (a <= -1.9e+72) {
		tmp = (b * a) * i;
	} else if (a <= 7.9e-10) {
		tmp = (j * t) * c;
	} else {
		tmp = (i * b) * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if a <= -1.9e+72:
		tmp = (b * a) * i
	elif a <= 7.9e-10:
		tmp = (j * t) * c
	else:
		tmp = (i * b) * a
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (a <= -1.9e+72)
		tmp = Float64(Float64(b * a) * i);
	elseif (a <= 7.9e-10)
		tmp = Float64(Float64(j * t) * c);
	else
		tmp = Float64(Float64(i * b) * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (a <= -1.9e+72)
		tmp = (b * a) * i;
	elseif (a <= 7.9e-10)
		tmp = (j * t) * c;
	else
		tmp = (i * b) * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -1.9e+72], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[a, 7.9e-10], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\

\mathbf{elif}\;a \leq 7.9 \cdot 10^{-10}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\

\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.90000000000000003e72

    1. Initial program 57.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6446.7

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites46.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6438.2

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    8. Applied rewrites38.2%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      2. lift-*.f64N/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(a \cdot b\right) \cdot i \]
      6. lower-*.f64N/A

        \[\leadsto \left(a \cdot b\right) \cdot i \]
      7. *-commutativeN/A

        \[\leadsto \left(b \cdot a\right) \cdot i \]
      8. lower-*.f6444.8

        \[\leadsto \left(b \cdot a\right) \cdot i \]
    10. Applied rewrites44.8%

      \[\leadsto \left(b \cdot a\right) \cdot i \]

    if -1.90000000000000003e72 < a < 7.8999999999999996e-10

    1. Initial program 75.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
      2. lower-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(c \cdot t + \left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      4. mul-1-negN/A

        \[\leadsto \left(c \cdot t + \left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      5. associate-*r*N/A

        \[\leadsto \left(c \cdot t + -1 \cdot \left(i \cdot y\right)\right) \cdot j \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot y\right) + c \cdot t\right) \cdot j \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y + c \cdot t\right) \cdot j \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y + c \cdot t\right) \cdot j \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), y, c \cdot t\right) \cdot j \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
      11. lift-*.f6445.1

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j \]
    5. Applied rewrites45.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j} \]
    6. Taylor expanded in y around 0

      \[\leadsto c \cdot \color{blue}{\left(j \cdot t\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6428.4

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    8. Applied rewrites28.4%

      \[\leadsto \left(j \cdot t\right) \cdot \color{blue}{c} \]

    if 7.8999999999999996e-10 < a

    1. Initial program 65.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      9. lower-neg.f6448.7

        \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites48.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lift-*.f6432.5

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    8. Applied rewrites32.5%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+72}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{-10}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 21.9% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \left(b \cdot a\right) \cdot i \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* b a) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (b * a) * 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 = (b * a) * 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 (b * a) * i;
}
def code(x, y, z, t, a, b, c, i, j):
	return (b * a) * i
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(b * a) * i)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (b * a) * i;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}

\\
\left(b \cdot a\right) \cdot i
\end{array}
Derivation
  1. Initial program 68.6%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
  2. Add Preprocessing
  3. Taylor expanded in b around inf

    \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
    2. lower-*.f64N/A

      \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
    3. fp-cancel-sub-sign-invN/A

      \[\leadsto \left(a \cdot i + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    4. *-commutativeN/A

      \[\leadsto \left(i \cdot a + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    5. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    6. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
    7. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(i, a, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
    9. lower-neg.f6440.4

      \[\leadsto \mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b \]
  5. Applied rewrites40.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b} \]
  6. Taylor expanded in z around 0

    \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(b \cdot i\right) \cdot a \]
    2. lower-*.f64N/A

      \[\leadsto \left(b \cdot i\right) \cdot a \]
    3. *-commutativeN/A

      \[\leadsto \left(i \cdot b\right) \cdot a \]
    4. lift-*.f6421.9

      \[\leadsto \left(i \cdot b\right) \cdot a \]
  8. Applied rewrites21.9%

    \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(i \cdot b\right) \cdot a \]
    2. lift-*.f64N/A

      \[\leadsto \left(i \cdot b\right) \cdot a \]
    3. *-commutativeN/A

      \[\leadsto \left(b \cdot i\right) \cdot a \]
    4. *-commutativeN/A

      \[\leadsto a \cdot \left(b \cdot \color{blue}{i}\right) \]
    5. associate-*r*N/A

      \[\leadsto \left(a \cdot b\right) \cdot i \]
    6. lower-*.f64N/A

      \[\leadsto \left(a \cdot b\right) \cdot i \]
    7. *-commutativeN/A

      \[\leadsto \left(b \cdot a\right) \cdot i \]
    8. lower-*.f6422.6

      \[\leadsto \left(b \cdot a\right) \cdot i \]
  10. Applied rewrites22.6%

    \[\leadsto \left(b \cdot a\right) \cdot i \]
  11. Final simplification22.6%

    \[\leadsto \left(b \cdot a\right) \cdot i \]
  12. Add Preprocessing

Developer Target 1: 70.0% accurate, 0.2× 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 - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\ t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\ \mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (+
          (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
          (/
           (* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
           (+ (* c t) (* i y)))))
        (t_2
         (-
          (* x (- (* z y) (* a t)))
          (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
   (if (< t -8.120978919195912e-33)
     t_2
     (if (< t -4.712553818218485e-169)
       t_1
       (if (< t -7.633533346031584e-308)
         t_2
         (if (< t 1.0535888557455487e-139) 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 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
	double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
	double tmp;
	if (t < -8.120978919195912e-33) {
		tmp = t_2;
	} else if (t < -4.712553818218485e-169) {
		tmp = t_1;
	} else if (t < -7.633533346031584e-308) {
		tmp = t_2;
	} else if (t < 1.0535888557455487e-139) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
    t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
    if (t < (-8.120978919195912d-33)) then
        tmp = t_2
    else if (t < (-4.712553818218485d-169)) then
        tmp = t_1
    else if (t < (-7.633533346031584d-308)) then
        tmp = t_2
    else if (t < 1.0535888557455487d-139) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
	double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
	double tmp;
	if (t < -8.120978919195912e-33) {
		tmp = t_2;
	} else if (t < -4.712553818218485e-169) {
		tmp = t_1;
	} else if (t < -7.633533346031584e-308) {
		tmp = t_2;
	} else if (t < 1.0535888557455487e-139) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y)))
	t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
	tmp = 0
	if t < -8.120978919195912e-33:
		tmp = t_2
	elif t < -4.712553818218485e-169:
		tmp = t_1
	elif t < -7.633533346031584e-308:
		tmp = t_2
	elif t < 1.0535888557455487e-139:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y))))
	t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j)))
	tmp = 0.0
	if (t < -8.120978919195912e-33)
		tmp = t_2;
	elseif (t < -4.712553818218485e-169)
		tmp = t_1;
	elseif (t < -7.633533346031584e-308)
		tmp = t_2;
	elseif (t < 1.0535888557455487e-139)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y)));
	t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
	tmp = 0.0;
	if (t < -8.120978919195912e-33)
		tmp = t_2;
	elseif (t < -4.712553818218485e-169)
		tmp = t_1;
	elseif (t < -7.633533346031584e-308)
		tmp = t_2;
	elseif (t < 1.0535888557455487e-139)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\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 - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2025064 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))