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

Percentage Accurate: 74.0% → 82.7%
Time: 18.4s
Alternatives: 24
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 24 alternatives:

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

Initial Program: 74.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 82.7% accurate, 0.5× speedup?

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

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

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


\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 92.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot \color{blue}{i} \]
    7. Applied rewrites54.7%

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

Alternative 2: 82.7% 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(-j, y, b \cdot t\right) \cdot i\\ \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 (- j) y (* b t)) i))))
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(-j, y, (b * t)) * i;
	}
	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(-j), y, Float64(b * t)) * i);
	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[((-j) * y + N[(b * t), $MachinePrecision]), $MachinePrecision] * i), $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(-j, y, b \cdot t\right) \cdot i\\


\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 92.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

    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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot \color{blue}{i} \]
    7. Applied rewrites54.7%

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

Alternative 3: 73.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;j \leq -8.2 \cdot 10^{+45} \lor \neg \left(j \leq 25000000000000\right):\\
\;\;\;\;\mathsf{fma}\left(-i, y, \mathsf{fma}\left(c, a, \frac{\mathsf{fma}\left(-t, i, c \cdot z\right) \cdot b}{-j}\right)\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -8.20000000000000025e45 or 2.5e13 < j

    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 x around 0

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

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

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

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

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

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

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

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

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

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

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

    if -8.20000000000000025e45 < j < 2.5e13

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 60.2% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.1e87 or 4.50000000000000024e77 < t

    1. Initial program 60.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e87 < t < -6.3999999999999998e-71

    1. Initial program 76.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.3999999999999998e-71 < t < 2e-82

    1. Initial program 76.1%

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

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

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

    if 2e-82 < t < 4.50000000000000024e77

    1. Initial program 86.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.1% accurate, 1.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if j < -2.9000000000000001e131

    1. Initial program 84.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000001e131 < j < 5.2e13

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2e13 < j < 2.50000000000000004e150

    1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + b \cdot t\right) \cdot \color{blue}{i} \]
    7. Applied rewrites76.4%

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

    if 2.50000000000000004e150 < j

    1. Initial program 64.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}{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 \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-*.f6477.8

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

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

Alternative 6: 57.4% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.1e87 or 4.50000000000000024e77 < t

    1. Initial program 60.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e87 < t < -3.3999999999999997e-179

    1. Initial program 82.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3999999999999997e-179 < t < 4.50000000000000024e77

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 56.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+121} \lor \neg \left(t \leq 4.5 \cdot 10^{+77}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.49999999999999949e121 or 4.50000000000000024e77 < t

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.49999999999999949e121 < t < 4.50000000000000024e77

    1. Initial program 77.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 51.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\ \mathbf{if}\;t \leq -3 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-163}:\\ \;\;\;\;\left(\left(-x\right) \cdot \mathsf{fma}\left(i, \frac{j}{x}, -z\right)\right) \cdot y\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(-b, z, j \cdot a\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 (- a) x (* i b)) t)))
   (if (<= t -3e+87)
     t_1
     (if (<= t 5.6e-163)
       (* (* (- x) (fma i (/ j x) (- z))) y)
       (if (<= t 1.65e+37) (* (fma (- b) z (* j a)) 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(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -3e+87) {
		tmp = t_1;
	} else if (t <= 5.6e-163) {
		tmp = (-x * fma(i, (j / x), -z)) * y;
	} else if (t <= 1.65e+37) {
		tmp = fma(-b, z, (j * a)) * c;
	} 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 <= -3e+87)
		tmp = t_1;
	elseif (t <= 5.6e-163)
		tmp = Float64(Float64(Float64(-x) * fma(i, Float64(j / x), Float64(-z))) * y);
	elseif (t <= 1.65e+37)
		tmp = Float64(fma(Float64(-b), z, Float64(j * a)) * 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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3e+87], t$95$1, If[LessEqual[t, 5.6e-163], N[(N[((-x) * N[(i * N[(j / x), $MachinePrecision] + (-z)), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.65e+37], N[(N[((-b) * z + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $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 -3 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9999999999999999e87 or 1.65e37 < t

    1. Initial program 61.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e87 < t < 5.5999999999999999e-163

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-1 \cdot \left(x \cdot \left(-1 \cdot z + \frac{i \cdot j}{x}\right)\right)\right) \cdot y \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \left(\left(-x\right) \cdot \left(-1 \cdot z + \frac{i \cdot j}{x}\right)\right) \cdot y \]
      5. +-commutativeN/A

        \[\leadsto \left(\left(-x\right) \cdot \left(\frac{i \cdot j}{x} + -1 \cdot z\right)\right) \cdot y \]
      6. associate-/l*N/A

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

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

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

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

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

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

    if 5.5999999999999999e-163 < t < 1.65e37

    1. Initial program 87.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \left(a \cdot j - b \cdot z\right) \]
      4. associate-+l-N/A

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(b \cdot z\right) + a \cdot j\right) \cdot \color{blue}{c} \]
    7. Applied rewrites59.2%

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

Alternative 9: 45.6% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;i \leq 1.55 \cdot 10^{-68}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

\mathbf{elif}\;i \leq 2.3 \cdot 10^{+234}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -1.72e103 or 1.55e-68 < i < 2.3000000000000001e234

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.72e103 < i < -1.30000000000000004e-193

    1. Initial program 76.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 c around inf

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

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

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

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

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

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

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

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

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

    if -1.30000000000000004e-193 < i < 1.55e-68

    1. Initial program 79.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 \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

    if 2.3000000000000001e234 < i

    1. Initial program 41.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. associate-*r*N/A

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

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

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

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

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

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

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

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

Alternative 10: 30.2% accurate, 1.6× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{-244}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+18}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.10000000000000015e-24 or 1.55e18 < y < 3.90000000000000007e224

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6445.2

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

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

    if -4.10000000000000015e-24 < y < 5.3999999999999999e-244

    1. Initial program 81.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 t around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.3999999999999999e-244 < y < 1.55e18

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.90000000000000007e224 < y

    1. Initial program 40.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. associate-*r*N/A

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

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

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

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

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

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

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

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

Alternative 11: 30.2% accurate, 1.6× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{-244}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+18}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.10000000000000015e-24 or 1.55e18 < y < 3.99999999999999988e224

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6445.2

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

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

    if -4.10000000000000015e-24 < y < 5.3999999999999999e-244

    1. Initial program 81.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 t around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.3999999999999999e-244 < y < 1.55e18

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999988e224 < y

    1. Initial program 40.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 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      5. lower-*.f6461.0

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

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

Alternative 12: 30.1% accurate, 1.6× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-243}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+18}:\\
\;\;\;\;\left(\left(-b\right) \cdot c\right) \cdot z\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.10000000000000015e-24 or 3e18 < y < 3.99999999999999988e224

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6445.2

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

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

    if -4.10000000000000015e-24 < y < 1.05e-243

    1. Initial program 81.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 t around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-243 < y < 3e18

    1. Initial program 76.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot \color{blue}{z}\right) \]
      3. associate-*r*N/A

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

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

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

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

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

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

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

        \[\leadsto \left(\left(-b\right) \cdot c\right) \cdot z \]
    11. Applied rewrites33.4%

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

    if 3.99999999999999988e224 < y

    1. Initial program 40.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 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      5. lower-*.f6461.0

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

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

Alternative 13: 51.8% 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 -3 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{-156}:\\ \;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(-b, z, j \cdot a\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 (- a) x (* i b)) t)))
   (if (<= t -3e+87)
     t_1
     (if (<= t 7.4e-156)
       (* (fma (- i) j (* z x)) y)
       (if (<= t 1.65e+37) (* (fma (- b) z (* j a)) 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(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -3e+87) {
		tmp = t_1;
	} else if (t <= 7.4e-156) {
		tmp = fma(-i, j, (z * x)) * y;
	} else if (t <= 1.65e+37) {
		tmp = fma(-b, z, (j * a)) * c;
	} 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 <= -3e+87)
		tmp = t_1;
	elseif (t <= 7.4e-156)
		tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y);
	elseif (t <= 1.65e+37)
		tmp = Float64(fma(Float64(-b), z, Float64(j * a)) * 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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3e+87], t$95$1, If[LessEqual[t, 7.4e-156], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.65e+37], N[(N[((-b) * z + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $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 -3 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9999999999999999e87 or 1.65e37 < t

    1. Initial program 61.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e87 < t < 7.4000000000000001e-156

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

    if 7.4000000000000001e-156 < t < 1.65e37

    1. Initial program 87.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \left(a \cdot j - b \cdot z\right) \]
      4. associate-+l-N/A

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot \left(b \cdot z\right) + a \cdot j\right) \cdot \color{blue}{c} \]
    7. Applied rewrites59.2%

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

Alternative 14: 52.3% 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 -3 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-248}:\\ \;\;\;\;\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(-b, z, j \cdot a\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 (- a) x (* i b)) t)))
   (if (<= t -3e+87)
     t_1
     (if (<= t 3.6e-248)
       (* (fma (- b) c (* y x)) z)
       (if (<= t 1.65e+37) (* (fma (- b) z (* j a)) 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(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -3e+87) {
		tmp = t_1;
	} else if (t <= 3.6e-248) {
		tmp = fma(-b, c, (y * x)) * z;
	} else if (t <= 1.65e+37) {
		tmp = fma(-b, z, (j * a)) * c;
	} 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 <= -3e+87)
		tmp = t_1;
	elseif (t <= 3.6e-248)
		tmp = Float64(fma(Float64(-b), c, Float64(y * x)) * z);
	elseif (t <= 1.65e+37)
		tmp = Float64(fma(Float64(-b), z, Float64(j * a)) * 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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3e+87], t$95$1, If[LessEqual[t, 3.6e-248], N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1.65e+37], N[(N[((-b) * z + N[(j * a), $MachinePrecision]), $MachinePrecision] * c), $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 -3 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9999999999999999e87 or 1.65e37 < t

    1. Initial program 61.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e87 < t < 3.59999999999999985e-248

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999985e-248 < t < 1.65e37

    1. Initial program 84.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \left(a \cdot j - b \cdot z\right) \]
      4. associate-+l-N/A

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

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

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

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

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

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

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

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

Alternative 15: 52.2% 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 -3 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-248}:\\ \;\;\;\;\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\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 (- a) x (* i b)) t)))
   (if (<= t -3e+87)
     t_1
     (if (<= t 3.6e-248)
       (* (fma (- b) c (* y x)) z)
       (if (<= t 1.65e+37) (* (fma j a (* (- b) z)) 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(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -3e+87) {
		tmp = t_1;
	} else if (t <= 3.6e-248) {
		tmp = fma(-b, c, (y * x)) * z;
	} else if (t <= 1.65e+37) {
		tmp = fma(j, a, (-b * z)) * c;
	} 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 <= -3e+87)
		tmp = t_1;
	elseif (t <= 3.6e-248)
		tmp = Float64(fma(Float64(-b), c, Float64(y * x)) * z);
	elseif (t <= 1.65e+37)
		tmp = Float64(fma(j, a, Float64(Float64(-b) * z)) * 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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3e+87], t$95$1, If[LessEqual[t, 3.6e-248], N[(N[((-b) * c + N[(y * x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1.65e+37], N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $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 -3 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9999999999999999e87 or 1.65e37 < t

    1. Initial program 61.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. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e87 < t < 3.59999999999999985e-248

    1. Initial program 73.5%

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

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

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

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

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(t\right)\right) \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} + \left(\mathsf{neg}\left(t\right)\right) \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\mathsf{fma}\left(z, c, \left(\mathsf{neg}\left(t\right)\right) \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(z, c, \color{blue}{\left(\mathsf{neg}\left(t\right)\right) \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lower-neg.f6473.5

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(z, c, \color{blue}{\left(-t\right)} \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites73.5%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\mathsf{fma}\left(z, c, \left(-t\right) \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. Taylor expanded in j around 0

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \left(-1 \cdot \left(i \cdot t\right) + c \cdot z\right)} \]
    6. Applied rewrites54.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(x \cdot y + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      4. mul-1-negN/A

        \[\leadsto \left(x \cdot y + \left(-1 \cdot b\right) \cdot c\right) \cdot z \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y + -1 \cdot \left(b \cdot c\right)\right) \cdot z \]
      6. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right) \cdot z \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot b\right) \cdot c + x \cdot y\right) \cdot z \]
      8. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(b\right)\right) \cdot c + x \cdot y\right) \cdot z \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(b\right), c, x \cdot y\right) \cdot z \]
      10. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-b, c, x \cdot y\right) \cdot z \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
      12. lower-*.f6451.7

        \[\leadsto \mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z \]
    9. Applied rewrites51.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-b, c, y \cdot x\right) \cdot z} \]

    if 3.59999999999999985e-248 < t < 1.65e37

    1. Initial program 84.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      4. *-commutativeN/A

        \[\leadsto \left(j \cdot a + \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6450.8

        \[\leadsto \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c \]
    5. Applied rewrites50.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 52.1% 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 -2.8 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-248}:\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\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 (- a) x (* i b)) t)))
   (if (<= t -2.8e+87)
     t_1
     (if (<= t 3.6e-248)
       (* (fma y x (* (- b) c)) z)
       (if (<= t 1.65e+37) (* (fma j a (* (- b) z)) 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(-a, x, (i * b)) * t;
	double tmp;
	if (t <= -2.8e+87) {
		tmp = t_1;
	} else if (t <= 3.6e-248) {
		tmp = fma(y, x, (-b * c)) * z;
	} else if (t <= 1.65e+37) {
		tmp = fma(j, a, (-b * z)) * c;
	} 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 <= -2.8e+87)
		tmp = t_1;
	elseif (t <= 3.6e-248)
		tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z);
	elseif (t <= 1.65e+37)
		tmp = Float64(fma(j, a, Float64(Float64(-b) * z)) * 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[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.8e+87], t$95$1, If[LessEqual[t, 3.6e-248], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 1.65e+37], N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $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 -2.8 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.6 \cdot 10^{-248}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.80000000000000015e87 or 1.65e37 < t

    1. Initial program 61.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. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z - t \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{c \cdot z} - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - \color{blue}{t \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      4. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(t\right)\right) \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} + \left(\mathsf{neg}\left(t\right)\right) \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\mathsf{fma}\left(z, c, \left(\mathsf{neg}\left(t\right)\right) \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(z, c, \color{blue}{\left(\mathsf{neg}\left(t\right)\right) \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
      8. lower-neg.f6461.8

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(z, c, \color{blue}{\left(-t\right)} \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    4. Applied rewrites61.8%

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\mathsf{fma}\left(z, c, \left(-t\right) \cdot i\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    5. Taylor expanded in j around 0

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \left(-1 \cdot \left(i \cdot t\right) + c \cdot z\right)} \]
    6. Applied rewrites70.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(-b\right) \cdot \mathsf{fma}\left(-t, i, c \cdot z\right)\right)} \]
    7. 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)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot \color{blue}{t} \]
      3. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - \left(-1 \cdot b\right) \cdot i\right) \cdot t \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \cdot t \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot x\right) + b \cdot i\right) \cdot t \]
      6. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot x + b \cdot i\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot a, x, b \cdot i\right) \cdot t \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), x, b \cdot i\right) \cdot t \]
      9. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, x, b \cdot i\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t \]
      11. lower-*.f6481.2

        \[\leadsto \mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t \]
    9. Applied rewrites81.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t} \]

    if -2.80000000000000015e87 < t < 3.59999999999999985e-248

    1. Initial program 73.5%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(x \cdot y + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x + \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, \left(\mathsf{neg}\left(b\right)\right) \cdot c\right) \cdot z \]
      7. lower-neg.f6448.6

        \[\leadsto \mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z \]
    5. Applied rewrites48.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z} \]

    if 3.59999999999999985e-248 < t < 1.65e37

    1. Initial program 84.4%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(a \cdot j - b \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot j - b \cdot z\right) \cdot \color{blue}{c} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(a \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      4. *-commutativeN/A

        \[\leadsto \left(j \cdot a + \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, a, \left(\mathsf{neg}\left(b\right)\right) \cdot z\right) \cdot c \]
      7. lower-neg.f6450.8

        \[\leadsto \mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c \]
    5. Applied rewrites50.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 51.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{-92} \lor \neg \left(x \leq 2.6 \cdot 10^{-85}\right):\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= x -2.05e-92) (not (<= x 2.6e-85)))
   (* (fma (- a) t (* z y)) x)
   (* (fma i t (* (- c) z)) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((x <= -2.05e-92) || !(x <= 2.6e-85)) {
		tmp = fma(-a, t, (z * y)) * x;
	} else {
		tmp = fma(i, t, (-c * z)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((x <= -2.05e-92) || !(x <= 2.6e-85))
		tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x);
	else
		tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[x, -2.05e-92], N[Not[LessEqual[x, 2.6e-85]], $MachinePrecision]], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{-92} \lor \neg \left(x \leq 2.6 \cdot 10^{-85}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.0500000000000001e-92 or 2.60000000000000011e-85 < x

    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 x around inf

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot \color{blue}{x} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x \]
      3. lower-*.f64N/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot \color{blue}{x} \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(y \cdot z + \left(\mathsf{neg}\left(a\right)\right) \cdot t\right) \cdot x \]
      6. mul-1-negN/A

        \[\leadsto \left(y \cdot z + \left(-1 \cdot a\right) \cdot t\right) \cdot x \]
      7. associate-*r*N/A

        \[\leadsto \left(y \cdot z + -1 \cdot \left(a \cdot t\right)\right) \cdot x \]
      8. +-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(a \cdot t\right) + y \cdot z\right) \cdot x \]
      9. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot a\right) \cdot t + y \cdot z\right) \cdot x \]
      10. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(a\right)\right) \cdot t + y \cdot z\right) \cdot x \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(a\right), t, y \cdot z\right) \cdot x \]
      12. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-a, t, y \cdot z\right) \cdot x \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
      14. lower-*.f6460.0

        \[\leadsto \mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x \]
    5. Applied rewrites60.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x} \]

    if -2.0500000000000001e-92 < x < 2.60000000000000011e-85

    1. Initial program 70.1%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6457.4

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites57.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{-92} \lor \neg \left(x \leq 2.6 \cdot 10^{-85}\right):\\ \;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 41.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot y\right) \cdot x\\ \mathbf{if}\;y \leq -4.5 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+18}:\\ \;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{+224}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* z y) x)))
   (if (<= y -4.5e+41)
     t_1
     (if (<= y 8.2e+18)
       (* (fma i t (* (- c) z)) b)
       (if (<= y 3.9e+224) t_1 (* (* (- i) j) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (z * y) * x;
	double tmp;
	if (y <= -4.5e+41) {
		tmp = t_1;
	} else if (y <= 8.2e+18) {
		tmp = fma(i, t, (-c * z)) * b;
	} else if (y <= 3.9e+224) {
		tmp = t_1;
	} else {
		tmp = (-i * j) * y;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(z * y) * x)
	tmp = 0.0
	if (y <= -4.5e+41)
		tmp = t_1;
	elseif (y <= 8.2e+18)
		tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b);
	elseif (y <= 3.9e+224)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(-i) * j) * y);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4.5e+41], t$95$1, If[LessEqual[y, 8.2e+18], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[y, 3.9e+224], t$95$1, N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z \cdot y\right) \cdot x\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.5000000000000001e41 or 8.2e18 < y < 3.90000000000000007e224

    1. Initial program 61.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. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6468.7

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites68.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6449.5

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites49.5%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if -4.5000000000000001e41 < y < 8.2e18

    1. Initial program 80.8%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6449.8

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites49.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]

    if 3.90000000000000007e224 < y

    1. Initial program 40.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. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6467.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites67.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    6. Taylor expanded in x around 0

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right)\right) \cdot y \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j\right) \cdot y \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j\right) \cdot y \]
      3. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j\right) \cdot y \]
      4. lift-neg.f6461.1

        \[\leadsto \left(\left(-i\right) \cdot j\right) \cdot y \]
    8. Applied rewrites61.1%

      \[\leadsto \left(\left(-i\right) \cdot j\right) \cdot y \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 30.5% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{+88}:\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-151}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{+42}:\\ \;\;\;\;\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 (<= t -1.15e+88)
   (* (- a) (* t x))
   (if (<= t -5.2e-151)
     (* (- i) (* j y))
     (if (<= t 8.6e+42) (* (* 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 (t <= -1.15e+88) {
		tmp = -a * (t * x);
	} else if (t <= -5.2e-151) {
		tmp = -i * (j * y);
	} else if (t <= 8.6e+42) {
		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 (t <= (-1.15d+88)) then
        tmp = -a * (t * x)
    else if (t <= (-5.2d-151)) then
        tmp = -i * (j * y)
    else if (t <= 8.6d+42) 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 (t <= -1.15e+88) {
		tmp = -a * (t * x);
	} else if (t <= -5.2e-151) {
		tmp = -i * (j * y);
	} else if (t <= 8.6e+42) {
		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 t <= -1.15e+88:
		tmp = -a * (t * x)
	elif t <= -5.2e-151:
		tmp = -i * (j * y)
	elif t <= 8.6e+42:
		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 (t <= -1.15e+88)
		tmp = Float64(Float64(-a) * Float64(t * x));
	elseif (t <= -5.2e-151)
		tmp = Float64(Float64(-i) * Float64(j * y));
	elseif (t <= 8.6e+42)
		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 (t <= -1.15e+88)
		tmp = -a * (t * x);
	elseif (t <= -5.2e-151)
		tmp = -i * (j * y);
	elseif (t <= 8.6e+42)
		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[LessEqual[t, -1.15e+88], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.2e-151], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e+42], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+88}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

\mathbf{elif}\;t \leq -5.2 \cdot 10^{-151}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\

\mathbf{elif}\;t \leq 8.6 \cdot 10^{+42}:\\
\;\;\;\;\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 4 regimes
  2. if t < -1.1500000000000001e88

    1. Initial program 56.0%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot t\right) \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(-t\right) \cdot \left(a \cdot x + \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot i}\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, \color{blue}{x}, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \]
      8. lower-neg.f6478.3

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) \]
    5. Applied rewrites78.3%

      \[\leadsto \color{blue}{\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6451.7

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
    8. Applied rewrites51.7%

      \[\leadsto \left(-a\right) \cdot \color{blue}{\left(t \cdot x\right)} \]

    if -1.1500000000000001e88 < t < -5.2000000000000001e-151

    1. Initial program 80.8%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{j \cdot \left(a \cdot c - i \cdot y\right) - b \cdot \left(c \cdot z - i \cdot t\right)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \cdot \left(c \cdot z - i \cdot t\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, \color{blue}{j}, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) \]
    5. Applied rewrites64.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot a\right), j, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)} \]
    6. Taylor expanded in y around inf

      \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(j \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
      3. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(j \cdot y\right) \]
      4. lift-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      5. lower-*.f6435.4

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    8. Applied rewrites35.4%

      \[\leadsto \left(-i\right) \cdot \color{blue}{\left(j \cdot y\right)} \]

    if -5.2000000000000001e-151 < t < 8.5999999999999996e42

    1. Initial program 76.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. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6449.5

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites49.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6432.6

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites32.6%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if 8.5999999999999996e42 < t

    1. Initial program 66.1%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6459.5

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites59.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6448.9

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    8. Applied rewrites48.9%

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 20: 29.8% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.25 \cdot 10^{-10} \lor \neg \left(t \leq 8.6 \cdot 10^{+42}\right):\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= t -2.25e-10) (not (<= t 8.6e+42))) (* (* i t) b) (* (* z y) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((t <= -2.25e-10) || !(t <= 8.6e+42)) {
		tmp = (i * t) * b;
	} else {
		tmp = (z * y) * x;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if ((t <= (-2.25d-10)) .or. (.not. (t <= 8.6d+42))) then
        tmp = (i * t) * b
    else
        tmp = (z * y) * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((t <= -2.25e-10) || !(t <= 8.6e+42)) {
		tmp = (i * t) * b;
	} else {
		tmp = (z * y) * x;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (t <= -2.25e-10) or not (t <= 8.6e+42):
		tmp = (i * t) * b
	else:
		tmp = (z * y) * x
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((t <= -2.25e-10) || !(t <= 8.6e+42))
		tmp = Float64(Float64(i * t) * b);
	else
		tmp = Float64(Float64(z * y) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if ((t <= -2.25e-10) || ~((t <= 8.6e+42)))
		tmp = (i * t) * b;
	else
		tmp = (z * y) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[t, -2.25e-10], N[Not[LessEqual[t, 8.6e+42]], $MachinePrecision]], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{-10} \lor \neg \left(t \leq 8.6 \cdot 10^{+42}\right):\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.25e-10 or 8.5999999999999996e42 < t

    1. Initial program 62.9%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6453.0

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites53.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6441.6

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    8. Applied rewrites41.6%

      \[\leadsto \left(i \cdot t\right) \cdot b \]

    if -2.25e-10 < t < 8.5999999999999996e42

    1. Initial program 77.8%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6450.9

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites50.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6431.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites31.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.25 \cdot 10^{-10} \lor \neg \left(t \leq 8.6 \cdot 10^{+42}\right):\\ \;\;\;\;\left(i \cdot t\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 29.9% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.011 \lor \neg \left(y \leq 1.3 \cdot 10^{+15}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot c\right) \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (or (<= y -0.011) (not (<= y 1.3e+15))) (* (* z y) x) (* (* j c) a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((y <= -0.011) || !(y <= 1.3e+15)) {
		tmp = (z * y) * x;
	} else {
		tmp = (j * c) * a;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if ((y <= (-0.011d0)) .or. (.not. (y <= 1.3d+15))) then
        tmp = (z * y) * x
    else
        tmp = (j * c) * a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if ((y <= -0.011) || !(y <= 1.3e+15)) {
		tmp = (z * y) * x;
	} else {
		tmp = (j * c) * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if (y <= -0.011) or not (y <= 1.3e+15):
		tmp = (z * y) * x
	else:
		tmp = (j * c) * a
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if ((y <= -0.011) || !(y <= 1.3e+15))
		tmp = Float64(Float64(z * y) * x);
	else
		tmp = Float64(Float64(j * c) * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if ((y <= -0.011) || ~((y <= 1.3e+15)))
		tmp = (z * y) * x;
	else
		tmp = (j * c) * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -0.011], N[Not[LessEqual[y, 1.3e+15]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.011 \lor \neg \left(y \leq 1.3 \cdot 10^{+15}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.010999999999999999 or 1.3e15 < y

    1. Initial program 61.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. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6466.3

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites66.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6442.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites42.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if -0.010999999999999999 < y < 1.3e15

    1. Initial program 80.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 x around 0

      \[\leadsto \color{blue}{j \cdot \left(a \cdot c - i \cdot y\right) - b \cdot \left(c \cdot z - i \cdot t\right)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(a \cdot c - i \cdot y\right) \cdot j + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \cdot \left(c \cdot z - i \cdot t\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(c \cdot a - i \cdot y\right) \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c \cdot a - y \cdot i\right) \cdot j + \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, \color{blue}{j}, \left(\mathsf{neg}\left(b\right)\right) \cdot \left(c \cdot z - i \cdot t\right)\right) \]
    5. Applied rewrites66.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-i, y, c \cdot a\right), j, \left(-b\right) \cdot \mathsf{fma}\left(-i, t, c \cdot z\right)\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot j\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(c \cdot j\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(j \cdot c\right) \cdot a \]
      4. lower-*.f6419.9

        \[\leadsto \left(j \cdot c\right) \cdot a \]
    8. Applied rewrites19.9%

      \[\leadsto \left(j \cdot c\right) \cdot \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.011 \lor \neg \left(y \leq 1.3 \cdot 10^{+15}\right):\\ \;\;\;\;\left(z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot c\right) \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 30.1% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{+87}:\\ \;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{+42}:\\ \;\;\;\;\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 (<= t -3e+87)
   (* (- a) (* t x))
   (if (<= t 8.6e+42) (* (* 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 (t <= -3e+87) {
		tmp = -a * (t * x);
	} else if (t <= 8.6e+42) {
		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 (t <= (-3d+87)) then
        tmp = -a * (t * x)
    else if (t <= 8.6d+42) 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 (t <= -3e+87) {
		tmp = -a * (t * x);
	} else if (t <= 8.6e+42) {
		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 t <= -3e+87:
		tmp = -a * (t * x)
	elif t <= 8.6e+42:
		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 (t <= -3e+87)
		tmp = Float64(Float64(-a) * Float64(t * x));
	elseif (t <= 8.6e+42)
		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 (t <= -3e+87)
		tmp = -a * (t * x);
	elseif (t <= 8.6e+42)
		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[LessEqual[t, -3e+87], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e+42], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+87}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\

\mathbf{elif}\;t \leq 8.6 \cdot 10^{+42}:\\
\;\;\;\;\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 3 regimes
  2. if t < -2.9999999999999999e87

    1. Initial program 56.0%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot t\right) \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)} \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(t\right)\right) \cdot \color{blue}{\left(a \cdot x - b \cdot i\right)} \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-t\right) \cdot \left(\color{blue}{a \cdot x} - b \cdot i\right) \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(-t\right) \cdot \left(a \cdot x + \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot i}\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, \color{blue}{x}, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(\mathsf{neg}\left(b\right)\right) \cdot i\right) \]
      8. lower-neg.f6478.3

        \[\leadsto \left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right) \]
    5. Applied rewrites78.3%

      \[\leadsto \color{blue}{\left(-t\right) \cdot \mathsf{fma}\left(a, x, \left(-b\right) \cdot i\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot a\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot x\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot \left(t \cdot \color{blue}{x}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
      5. lower-*.f6451.7

        \[\leadsto \left(-a\right) \cdot \left(t \cdot x\right) \]
    8. Applied rewrites51.7%

      \[\leadsto \left(-a\right) \cdot \color{blue}{\left(t \cdot x\right)} \]

    if -2.9999999999999999e87 < t < 8.5999999999999996e42

    1. Initial program 77.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6450.3

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    5. Applied rewrites50.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6430.4

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    8. Applied rewrites30.4%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]

    if 8.5999999999999996e42 < t

    1. Initial program 66.1%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(i \cdot t - c \cdot z\right) \cdot \color{blue}{b} \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(i \cdot t + \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(-1 \cdot c\right) \cdot z\right) \cdot b \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i, t, \left(\mathsf{neg}\left(c\right)\right) \cdot z\right) \cdot b \]
      8. lower-neg.f6459.5

        \[\leadsto \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b \]
    5. Applied rewrites59.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b} \]
    6. Taylor expanded in z around 0

      \[\leadsto \left(i \cdot t\right) \cdot b \]
    7. Step-by-step derivation
      1. lower-*.f6448.9

        \[\leadsto \left(i \cdot t\right) \cdot b \]
    8. Applied rewrites48.9%

      \[\leadsto \left(i \cdot t\right) \cdot b \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 23: 22.1% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \left(z \cdot y\right) \cdot x \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* z y) x))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (z * y) * x;
}
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 = (z * y) * x
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 (z * y) * x;
}
def code(x, y, z, t, a, b, c, i, j):
	return (z * y) * x
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(z * y) * x)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (z * y) * x;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}

\\
\left(z \cdot y\right) \cdot x
\end{array}
Derivation
  1. Initial program 71.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. associate-*r*N/A

      \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
    4. mul-1-negN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
    5. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
    6. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    8. lower-*.f6439.4

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
  5. Applied rewrites39.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6423.1

      \[\leadsto \left(z \cdot y\right) \cdot x \]
  8. Applied rewrites23.1%

    \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
  9. Add Preprocessing

Alternative 24: 21.8% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \left(y \cdot x\right) \cdot z \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* y x) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (y * x) * z;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = (y * x) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (y * x) * z;
}
def code(x, y, z, t, a, b, c, i, j):
	return (y * x) * z
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(y * x) * z)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (y * x) * z;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}

\\
\left(y \cdot x\right) \cdot z
\end{array}
Derivation
  1. Initial program 71.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. associate-*r*N/A

      \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
    4. mul-1-negN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
    5. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
    6. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    8. lower-*.f6439.4

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
  5. Applied rewrites39.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, 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-*.f6423.1

      \[\leadsto \left(z \cdot y\right) \cdot x \]
  8. Applied rewrites23.1%

    \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    2. *-commutativeN/A

      \[\leadsto x \cdot \left(z \cdot \color{blue}{y}\right) \]
    3. lift-*.f64N/A

      \[\leadsto x \cdot \left(z \cdot y\right) \]
    4. *-commutativeN/A

      \[\leadsto x \cdot \left(y \cdot z\right) \]
    5. associate-*r*N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    6. lower-*.f64N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    7. *-commutativeN/A

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    8. lower-*.f6421.3

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  10. Applied rewrites21.3%

    \[\leadsto \left(y \cdot x\right) \cdot z \]
  11. Add Preprocessing

Developer Target 1: 58.9% 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 2025043 
(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)))))