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

Percentage Accurate: 73.7% → 81.6%
Time: 12.6s
Alternatives: 19
Speedup: 0.5×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 73.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 81.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 89.6%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      12. lower-*.f6454.3

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

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

Alternative 2: 71.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 89.6%

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

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

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

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

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot c\right) \cdot a \]
      4. lower-*.f6481.8

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot c\right) \cdot a \]
    5. Applied rewrites81.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      12. lower-*.f6454.3

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

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

Alternative 3: 66.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -6 \cdot 10^{+70} \lor \neg \left(i \leq 4 \cdot 10^{+197}\right):\\
\;\;\;\;\mathsf{fma}\left(-y, j, b \cdot t\right) \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -5.99999999999999952e70 or 3.9999999999999998e197 < i

    1. Initial program 61.4%

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

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot y\right) \cdot j + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \cdot i \]
      6. metadata-evalN/A

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

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

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

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

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

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

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

    if -5.99999999999999952e70 < i < 3.9999999999999998e197

    1. Initial program 81.4%

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

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

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

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

Alternative 4: 53.6% accurate, 1.2× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.54999999999999996e83 or 2.05e-17 < x

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x \]
      15. lower-*.f6472.5

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

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

    if -1.54999999999999996e83 < x < -6.00000000000000033e-55

    1. Initial program 66.3%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    5. Applied rewrites53.2%

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

    if -6.00000000000000033e-55 < x < -2.4999999999999999e-226

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(z \cdot b\right) + a \cdot j\right) \cdot c \]
      8. associate-*r*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-z, b, j \cdot a\right) \cdot c \]
      13. lower-*.f6461.5

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

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

    if -2.4999999999999999e-226 < x < 6.19999999999999991e-253

    1. Initial program 64.5%

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

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot y\right) \cdot j + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \cdot i \]
      6. metadata-evalN/A

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

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

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

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

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

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

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

    if 6.19999999999999991e-253 < x < 2.05e-17

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      12. lower-*.f6460.8

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

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

Alternative 5: 53.7% accurate, 1.2× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.54999999999999996e83 or 2.05e-17 < x

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x \]
      15. lower-*.f6472.5

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

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

    if -1.54999999999999996e83 < x < -6.00000000000000033e-55

    1. Initial program 66.3%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    5. Applied rewrites53.2%

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

    if -6.00000000000000033e-55 < x < -2.4999999999999999e-226

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. lower-*.f6474.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      14. lower-neg.f6461.5

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

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

    if -2.4999999999999999e-226 < x < 6.19999999999999991e-253

    1. Initial program 64.5%

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

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

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot y\right) \cdot j + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \cdot i \]
      6. metadata-evalN/A

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

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

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

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

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

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

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

    if 6.19999999999999991e-253 < x < 2.05e-17

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      12. lower-*.f6460.8

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

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

Alternative 6: 60.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+72}:\\
\;\;\;\;\left(\mathsf{fma}\left(b, \frac{i}{a}, -x\right) \cdot a\right) \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.3e72

    1. Initial program 73.0%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{b \cdot i}{a} + -1 \cdot x\right) \cdot a\right) \cdot t \]
      4. associate-/l*N/A

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

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

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

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

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

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

    if -3.3e72 < t < 7.20000000000000039e78

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. lower-*.f6479.0

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

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. lower-*.f6468.0

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

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

    if 7.20000000000000039e78 < t

    1. Initial program 64.0%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

Alternative 7: 60.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+72}:\\
\;\;\;\;\left(\mathsf{fma}\left(b, \frac{i}{a}, -x\right) \cdot a\right) \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.5000000000000001e72

    1. Initial program 73.0%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{b \cdot i}{a} + -1 \cdot x\right) \cdot a\right) \cdot t \]
      4. associate-/l*N/A

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

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

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

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

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

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

    if -3.5000000000000001e72 < t < 7.20000000000000039e78

    1. Initial program 80.3%

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

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

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

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

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

        \[\leadsto \left(z \cdot x\right) \cdot y + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. lower-*.f6467.4

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

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

    if 7.20000000000000039e78 < t

    1. Initial program 64.0%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

Alternative 8: 51.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\ t_2 := \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+84}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-205}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-200}:\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-29}:\\ \;\;\;\;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 (* (fma (- t) x (* j c)) a)) (t_2 (* (fma (- j) i (* z x)) y)))
   (if (<= y -1.95e+84)
     t_2
     (if (<= y -1.02e-205)
       t_1
       (if (<= y 3.5e-200)
         (* (fma j a (* (- z) b)) c)
         (if (<= y 1.85e-29) 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(-t, x, (j * c)) * a;
	double t_2 = fma(-j, i, (z * x)) * y;
	double tmp;
	if (y <= -1.95e+84) {
		tmp = t_2;
	} else if (y <= -1.02e-205) {
		tmp = t_1;
	} else if (y <= 3.5e-200) {
		tmp = fma(j, a, (-z * b)) * c;
	} else if (y <= 1.85e-29) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(fma(Float64(-t), x, Float64(j * c)) * a)
	t_2 = Float64(fma(Float64(-j), i, Float64(z * x)) * y)
	tmp = 0.0
	if (y <= -1.95e+84)
		tmp = t_2;
	elseif (y <= -1.02e-205)
		tmp = t_1;
	elseif (y <= 3.5e-200)
		tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c);
	elseif (y <= 1.85e-29)
		tmp = 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[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-j) * i + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.95e+84], t$95$2, If[LessEqual[y, -1.02e-205], t$95$1, If[LessEqual[y, 3.5e-200], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 1.85e-29], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.02 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.95000000000000008e84 or 1.8499999999999999e-29 < y

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

    if -1.95000000000000008e84 < y < -1.02000000000000001e-205 or 3.50000000000000023e-200 < y < 1.8499999999999999e-29

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.02000000000000001e-205 < y < 3.50000000000000023e-200

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 53.6% accurate, 1.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.54999999999999996e83 or 2.05e-17 < x

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x \]
      15. lower-*.f6472.5

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

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

    if -1.54999999999999996e83 < x < -6.00000000000000033e-55

    1. Initial program 66.3%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    5. Applied rewrites53.2%

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

    if -6.00000000000000033e-55 < x < -3.5000000000000003e-229

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      14. lower-neg.f6459.5

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

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

    if -3.5000000000000003e-229 < x < 2.05e-17

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      12. lower-*.f6455.6

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

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

Alternative 10: 51.3% accurate, 1.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.99999999999999952e73 or 7.5000000000000004e-37 < y

    1. Initial program 72.3%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

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

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

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

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

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

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

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

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

    if -9.99999999999999952e73 < y < -1e18

    1. Initial program 78.7%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

    if -1e18 < y < 7.5000000000000004e-37

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 50.5% accurate, 1.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.49999999999999947e135 or 3.4000000000000001e58 < z

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999947e135 < z < -8.499999999999999e-86

    1. Initial program 73.6%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    5. Applied rewrites51.2%

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

    if -8.499999999999999e-86 < z < 3.4000000000000001e58

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j \]
      12. lower-*.f6454.3

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

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

Alternative 12: 52.7% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\ \mathbf{if}\;t \leq -4.8 \cdot 10^{+28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-301}:\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+18}:\\ \;\;\;\;\mathsf{fma}\left(-c, b, y \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (fma (- a) x (* i b)) t)))
   (if (<= t -4.8e+28)
     t_1
     (if (<= t 8e-301)
       (* (fma j a (* (- z) b)) c)
       (if (<= t 1.1e+18) (* (fma (- c) b (* y x)) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = fma(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -4.8e+28) {
		tmp = t_1;
	} else if (t <= 8e-301) {
		tmp = fma(j, a, (-z * b)) * c;
	} else if (t <= 1.1e+18) {
		tmp = fma(-c, b, (y * x)) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(fma(Float64(-a), x, Float64(i * b)) * t)
	tmp = 0.0
	if (t <= -4.8e+28)
		tmp = t_1;
	elseif (t <= 8e-301)
		tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c);
	elseif (t <= 1.1e+18)
		tmp = Float64(fma(Float64(-c), b, Float64(y * x)) * 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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.8e+28], t$95$1, If[LessEqual[t, 8e-301], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, 1.1e+18], N[(N[((-c) * b + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.79999999999999962e28 or 1.1e18 < t

    1. Initial program 70.8%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

    if -4.79999999999999962e28 < t < 8.00000000000000053e-301

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000053e-301 < t < 1.1e18

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 51.4% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\ \mathbf{if}\;t \leq -4.8 \cdot 10^{+28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-79}:\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{+17}:\\ \;\;\;\;\left(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 (- a) x (* i b)) t)))
   (if (<= t -4.8e+28)
     t_1
     (if (<= t 2.6e-79)
       (* (fma j a (* (- z) b)) c)
       (if (<= t 9.2e+17) (* (* 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(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -4.8e+28) {
		tmp = t_1;
	} else if (t <= 2.6e-79) {
		tmp = fma(j, a, (-z * b)) * c;
	} else if (t <= 9.2e+17) {
		tmp = (z * y) * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(fma(Float64(-a), x, Float64(i * b)) * t)
	tmp = 0.0
	if (t <= -4.8e+28)
		tmp = t_1;
	elseif (t <= 2.6e-79)
		tmp = Float64(fma(j, a, Float64(Float64(-z) * b)) * c);
	elseif (t <= 9.2e+17)
		tmp = Float64(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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.8e+28], t$95$1, If[LessEqual[t, 2.6e-79], N[(N[(j * a + N[((-z) * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t, 9.2e+17], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq 9.2 \cdot 10^{+17}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.79999999999999962e28 or 9.2e17 < t

    1. Initial program 70.8%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

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

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

    if -4.79999999999999962e28 < t < 2.59999999999999994e-79

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. lower-*.f6482.3

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. Applied rewrites82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      14. lower-neg.f6449.0

        \[\leadsto \mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c \]
    8. Applied rewrites49.0%

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

    if 2.59999999999999994e-79 < t < 9.2e17

    1. Initial program 65.1%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6460.7

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

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

Alternative 14: 42.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3600000000000 \lor \neg \left(c \leq 2.45 \cdot 10^{-55}\right):\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.6e12 or 2.45000000000000018e-55 < c

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      14. lower-neg.f6459.4

        \[\leadsto \mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c \]
    8. Applied rewrites59.4%

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

    if -3.6e12 < c < 2.45000000000000018e-55

    1. Initial program 82.5%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6436.1

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

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

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

Alternative 15: 29.9% accurate, 2.1× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.1 \cdot 10^{+143}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-74}:\\
\;\;\;\;\left(\left(-x\right) \cdot a\right) \cdot t\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{+59}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\

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


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

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6460.6

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

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

    if -7.10000000000000043e143 < z < -4.10000000000000032e-74

    1. Initial program 72.5%

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

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

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    5. Applied rewrites51.2%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(x\right)\right) \cdot a\right) \cdot t \]
      7. lower-neg.f6434.6

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

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

    if -4.10000000000000032e-74 < z < 1.84999999999999999e59

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. lower-*.f6475.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(j \cdot a\right) \cdot c \]
    11. Applied rewrites37.1%

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

    if 1.84999999999999999e59 < z

    1. Initial program 67.8%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      2. lower-*.f6449.1

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

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

Alternative 16: 30.4% accurate, 2.6× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-60} \lor \neg \left(z \leq 2 \cdot 10^{-33}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5999999999999996e-60 or 2.0000000000000001e-33 < z

    1. Initial program 69.7%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot i + x \cdot z\right) \cdot y \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), i, x \cdot z\right) \cdot y \]
      7. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, i, x \cdot z\right) \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
      9. lower-*.f6450.8

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
    5. Applied rewrites50.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y} \]
    6. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6436.8

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites36.8%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if -6.5999999999999996e-60 < z < 2.0000000000000001e-33

    1. Initial program 85.9%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \left(x \cdot \color{blue}{\left(z \cdot \left(y + -1 \cdot \frac{a \cdot t}{z}\right)\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(\left(y + -1 \cdot \frac{a \cdot t}{z}\right) \cdot \color{blue}{z}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(\left(y + -1 \cdot \frac{a \cdot t}{z}\right) \cdot \color{blue}{z}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(\left(y + \frac{a \cdot t}{z} \cdot -1\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(\frac{a \cdot t}{z}\right)\right) \cdot -1\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(\frac{a \cdot t}{z} \cdot -1\right)\right)\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(-1 \cdot \frac{a \cdot t}{z}\right)\right)\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. distribute-lft-neg-outN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. metadata-evalN/A

        \[\leadsto \left(x \cdot \left(\left(y - 1 \cdot \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      9. *-lft-identityN/A

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      10. lower--.f64N/A

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      11. lower-/.f64N/A

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. lower-*.f6478.0

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. Applied rewrites78.0%

      \[\leadsto \left(x \cdot \color{blue}{\left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    6. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      4. mul-1-negN/A

        \[\leadsto \left(a \cdot j + \left(-1 \cdot b\right) \cdot z\right) \cdot c \]
      5. associate-*r*N/A

        \[\leadsto \left(a \cdot j + -1 \cdot \left(b \cdot z\right)\right) \cdot c \]
      6. *-commutativeN/A

        \[\leadsto \left(j \cdot a + -1 \cdot \left(b \cdot z\right)\right) \cdot c \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, -1 \cdot \left(b \cdot z\right)\right) \cdot c \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(j, a, \mathsf{neg}\left(b \cdot z\right)\right) \cdot c \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, a, \mathsf{neg}\left(z \cdot b\right)\right) \cdot c \]
      10. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(-1 \cdot z\right) \cdot b\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(-1 \cdot z\right) \cdot b\right) \cdot c \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      14. lower-neg.f6444.5

        \[\leadsto \mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c \]
    8. Applied rewrites44.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c} \]
    9. Taylor expanded in z around 0

      \[\leadsto \left(a \cdot j\right) \cdot c \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot a\right) \cdot c \]
      2. lower-*.f6440.6

        \[\leadsto \left(j \cdot a\right) \cdot c \]
    11. Applied rewrites40.6%

      \[\leadsto \left(j \cdot a\right) \cdot c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-60} \lor \neg \left(z \leq 2 \cdot 10^{-33}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot a\right) \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 29.4% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.06 \cdot 10^{+83} \lor \neg \left(x \leq 1.25 \cdot 10^{-83}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= x -2.06e+83) (not (<= x 1.25e-83))) (* (* z y) x) (* (* i t) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((x <= -2.06e+83) || !(x <= 1.25e-83)) {
		tmp = (z * y) * x;
	} else {
		tmp = (i * t) * b;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if ((x <= (-2.06d+83)) .or. (.not. (x <= 1.25d-83))) then
        tmp = (z * y) * x
    else
        tmp = (i * t) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((x <= -2.06e+83) || !(x <= 1.25e-83)) {
		tmp = (z * y) * x;
	} else {
		tmp = (i * t) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (x <= -2.06e+83) or not (x <= 1.25e-83):
		tmp = (z * y) * x
	else:
		tmp = (i * t) * b
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((x <= -2.06e+83) || !(x <= 1.25e-83))
		tmp = Float64(Float64(z * y) * x);
	else
		tmp = Float64(Float64(i * t) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if ((x <= -2.06e+83) || ~((x <= 1.25e-83)))
		tmp = (z * y) * x;
	else
		tmp = (i * t) * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[x, -2.06e+83], N[Not[LessEqual[x, 1.25e-83]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.06 \cdot 10^{+83} \lor \neg \left(x \leq 1.25 \cdot 10^{-83}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.06e83 or 1.25e-83 < x

    1. Initial program 77.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i \cdot j\right)\right) + x \cdot z\right) \cdot y \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j \cdot i\right)\right) + x \cdot z\right) \cdot y \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot i + x \cdot z\right) \cdot y \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), i, x \cdot z\right) \cdot y \]
      7. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, i, x \cdot z\right) \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
      9. lower-*.f6452.3

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
    5. Applied rewrites52.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y} \]
    6. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6440.8

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites40.8%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if -2.06e83 < x < 1.25e-83

    1. Initial program 74.5%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto t \cdot \left(-1 \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)}\right) \]
      2. associate-*r*N/A

        \[\leadsto \left(t \cdot -1\right) \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)} \]
      3. *-commutativeN/A

        \[\leadsto \left(-1 \cdot t\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      4. associate-*r*N/A

        \[\leadsto -1 \cdot \color{blue}{\left(t \cdot \left(a \cdot x - b \cdot i\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto -1 \cdot \left(\left(a \cdot x - b \cdot i\right) \cdot \color{blue}{t}\right) \]
      6. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
      7. distribute-lft-out--N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t \]
      8. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
    5. Applied rewrites38.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t} \]
    6. Taylor expanded in x around 0

      \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t\right) \cdot b \]
      3. lower-*.f6429.7

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    8. Applied rewrites29.7%

      \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.06 \cdot 10^{+83} \lor \neg \left(x \leq 1.25 \cdot 10^{-83}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 30.5% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-60}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+59}:\\ \;\;\;\;\left(j \cdot a\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -6.6e-60)
   (* (* z y) x)
   (if (<= z 1.85e+59) (* (* j a) c) (* (* z x) y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -6.6e-60) {
		tmp = (z * y) * x;
	} else if (z <= 1.85e+59) {
		tmp = (j * a) * c;
	} else {
		tmp = (z * x) * y;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (z <= (-6.6d-60)) then
        tmp = (z * y) * x
    else if (z <= 1.85d+59) then
        tmp = (j * a) * c
    else
        tmp = (z * x) * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -6.6e-60) {
		tmp = (z * y) * x;
	} else if (z <= 1.85e+59) {
		tmp = (j * a) * c;
	} else {
		tmp = (z * x) * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -6.6e-60:
		tmp = (z * y) * x
	elif z <= 1.85e+59:
		tmp = (j * a) * c
	else:
		tmp = (z * x) * y
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -6.6e-60)
		tmp = Float64(Float64(z * y) * x);
	elseif (z <= 1.85e+59)
		tmp = Float64(Float64(j * a) * c);
	else
		tmp = Float64(Float64(z * x) * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -6.6e-60)
		tmp = (z * y) * x;
	elseif (z <= 1.85e+59)
		tmp = (j * a) * c;
	else
		tmp = (z * x) * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -6.6e-60], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.85e+59], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{+59}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.5999999999999996e-60

    1. Initial program 72.1%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i \cdot j\right)\right) + x \cdot z\right) \cdot y \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j \cdot i\right)\right) + x \cdot z\right) \cdot y \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot i + x \cdot z\right) \cdot y \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), i, x \cdot z\right) \cdot y \]
      7. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, i, x \cdot z\right) \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
      9. lower-*.f6448.1

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
    5. Applied rewrites48.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y} \]
    6. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lower-*.f6436.2

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites36.2%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if -6.5999999999999996e-60 < z < 1.84999999999999999e59

    1. Initial program 81.8%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \left(x \cdot \color{blue}{\left(z \cdot \left(y + -1 \cdot \frac{a \cdot t}{z}\right)\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(\left(y + -1 \cdot \frac{a \cdot t}{z}\right) \cdot \color{blue}{z}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(\left(y + -1 \cdot \frac{a \cdot t}{z}\right) \cdot \color{blue}{z}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(\left(y + \frac{a \cdot t}{z} \cdot -1\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(\frac{a \cdot t}{z}\right)\right) \cdot -1\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(\frac{a \cdot t}{z} \cdot -1\right)\right)\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(-1 \cdot \frac{a \cdot t}{z}\right)\right)\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. distribute-lft-neg-outN/A

        \[\leadsto \left(x \cdot \left(\left(y - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. metadata-evalN/A

        \[\leadsto \left(x \cdot \left(\left(y - 1 \cdot \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      9. *-lft-identityN/A

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      10. lower--.f64N/A

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      11. lower-/.f64N/A

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      12. lower-*.f6475.6

        \[\leadsto \left(x \cdot \left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. Applied rewrites75.6%

      \[\leadsto \left(x \cdot \color{blue}{\left(\left(y - \frac{a \cdot t}{z}\right) \cdot z\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    6. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      4. mul-1-negN/A

        \[\leadsto \left(a \cdot j + \left(-1 \cdot b\right) \cdot z\right) \cdot c \]
      5. associate-*r*N/A

        \[\leadsto \left(a \cdot j + -1 \cdot \left(b \cdot z\right)\right) \cdot c \]
      6. *-commutativeN/A

        \[\leadsto \left(j \cdot a + -1 \cdot \left(b \cdot z\right)\right) \cdot c \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, -1 \cdot \left(b \cdot z\right)\right) \cdot c \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(j, a, \mathsf{neg}\left(b \cdot z\right)\right) \cdot c \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, a, \mathsf{neg}\left(z \cdot b\right)\right) \cdot c \]
      10. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(-1 \cdot z\right) \cdot b\right) \cdot c \]
      12. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(-1 \cdot z\right) \cdot b\right) \cdot c \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(z\right)\right) \cdot b\right) \cdot c \]
      14. lower-neg.f6442.8

        \[\leadsto \mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c \]
    8. Applied rewrites42.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, a, \left(-z\right) \cdot b\right) \cdot c} \]
    9. Taylor expanded in z around 0

      \[\leadsto \left(a \cdot j\right) \cdot c \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot a\right) \cdot c \]
      2. lower-*.f6437.4

        \[\leadsto \left(j \cdot a\right) \cdot c \]
    11. Applied rewrites37.4%

      \[\leadsto \left(j \cdot a\right) \cdot c \]

    if 1.84999999999999999e59 < z

    1. Initial program 67.8%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i \cdot j\right)\right) + x \cdot z\right) \cdot y \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j \cdot i\right)\right) + x \cdot z\right) \cdot y \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot i + x \cdot z\right) \cdot y \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), i, x \cdot z\right) \cdot y \]
      7. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, i, x \cdot z\right) \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
      9. lower-*.f6456.7

        \[\leadsto \mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y \]
    5. Applied rewrites56.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, i, z \cdot x\right) \cdot y} \]
    6. Taylor expanded in x around inf

      \[\leadsto \left(x \cdot z\right) \cdot y \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      2. lower-*.f6449.1

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    8. Applied rewrites49.1%

      \[\leadsto \left(z \cdot x\right) \cdot y \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 22.3% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \left(i \cdot t\right) \cdot b \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* i t) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (i * t) * b;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = (i * t) * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (i * t) * b;
}
def code(x, y, z, t, a, b, c, i, j):
	return (i * t) * b
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(i * t) * b)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (i * t) * b;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]
\begin{array}{l}

\\
\left(i \cdot t\right) \cdot b
\end{array}
Derivation
  1. Initial program 76.0%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
  2. Add Preprocessing
  3. Taylor expanded in t around inf

    \[\leadsto \color{blue}{t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right)} \]
  4. Step-by-step derivation
    1. distribute-lft-out--N/A

      \[\leadsto t \cdot \left(-1 \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)}\right) \]
    2. associate-*r*N/A

      \[\leadsto \left(t \cdot -1\right) \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)} \]
    3. *-commutativeN/A

      \[\leadsto \left(-1 \cdot t\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
    4. associate-*r*N/A

      \[\leadsto -1 \cdot \color{blue}{\left(t \cdot \left(a \cdot x - b \cdot i\right)\right)} \]
    5. *-commutativeN/A

      \[\leadsto -1 \cdot \left(\left(a \cdot x - b \cdot i\right) \cdot \color{blue}{t}\right) \]
    6. associate-*r*N/A

      \[\leadsto \left(-1 \cdot \left(a \cdot x - b \cdot i\right)\right) \cdot \color{blue}{t} \]
    7. distribute-lft-out--N/A

      \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot t \]
    8. lower-*.f64N/A

      \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
  5. Applied rewrites38.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t} \]
  6. Taylor expanded in x around 0

    \[\leadsto b \cdot \color{blue}{\left(i \cdot t\right)} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    2. lower-*.f64N/A

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    3. lower-*.f6420.8

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  8. Applied rewrites20.8%

    \[\leadsto \left(i \cdot t\right) \cdot \color{blue}{b} \]
  9. Add Preprocessing

Developer Target 1: 59.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\ t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\ \mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\ \;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* j (- (* c a) (* y i))))
        (t_2
         (+
          (-
           (* x (- (* y z) (* t a)))
           (/
            (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0)))
            (+ (* c z) (* t i))))
          t_1)))
   (if (< x -1.469694296777705e-64)
     t_2
     (if (< x 3.2113527362226803e-147)
       (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) t_1))
       t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = j * ((c * a) - (y * i));
	double t_2 = ((x * ((y * z) - (t * a))) - ((b * (pow((c * z), 2.0) - pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
	double tmp;
	if (x < -1.469694296777705e-64) {
		tmp = t_2;
	} else if (x < 3.2113527362226803e-147) {
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = j * ((c * a) - (y * i))
    t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
    if (x < (-1.469694296777705d-64)) then
        tmp = t_2
    else if (x < 3.2113527362226803d-147) then
        tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = j * ((c * a) - (y * i));
	double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
	double tmp;
	if (x < -1.469694296777705e-64) {
		tmp = t_2;
	} else if (x < 3.2113527362226803e-147) {
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = j * ((c * a) - (y * i))
	t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1
	tmp = 0
	if x < -1.469694296777705e-64:
		tmp = t_2
	elif x < 3.2113527362226803e-147:
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i)))
	t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1)
	tmp = 0.0
	if (x < -1.469694296777705e-64)
		tmp = t_2;
	elseif (x < 3.2113527362226803e-147)
		tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - t_1));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = j * ((c * a) - (y * i));
	t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1;
	tmp = 0.0;
	if (x < -1.469694296777705e-64)
		tmp = t_2;
	elseif (x < 3.2113527362226803e-147)
		tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2025026 
(FPCore (x y z t a b c i j)
  :name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< x -293938859355541/2000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 32113527362226803/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))