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

Percentage Accurate: 74.1% → 85.0%
Time: 18.5s
Alternatives: 15
Speedup: 0.9×

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

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

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


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

    1. Initial program 92.6%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + \left(\left(x \cdot y\right) \cdot z - \color{blue}{\left(b \cdot c\right) \cdot z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \color{blue}{\left(\mathsf{neg}\left(a \cdot x\right)\right)} + b \cdot i, z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.4% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.7999999999999998e182 or 9.00000000000000004e118 < y

    1. Initial program 57.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. *-lowering-*.f64N/A

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

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

        \[\leadsto y \cdot \left(\color{blue}{j \cdot \left(-1 \cdot i\right)} + x \cdot z\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(j, -1 \cdot i, x \cdot z\right)} \]
      5. neg-mul-1N/A

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(j, \mathsf{neg}\left(i\right), \color{blue}{z \cdot x}\right) \]
      8. *-lowering-*.f6479.4

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

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

    if -7.7999999999999998e182 < y < 9.00000000000000004e118

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + \left(\left(x \cdot y\right) \cdot z - \color{blue}{\left(b \cdot c\right) \cdot z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

Alternative 3: 67.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;j \leq -8 \cdot 10^{+162}:\\
\;\;\;\;i \cdot \left(j \cdot \left(\frac{a \cdot c}{i} - y\right)\right)\\

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

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


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

    1. Initial program 62.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 i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(-1 \cdot \frac{\left(a \cdot \left(c \cdot j\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) - b \cdot \left(c \cdot z\right)}{i} + j \cdot y\right) - b \cdot t\right)\right)} \]
    4. Simplified59.6%

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

      \[\leadsto \color{blue}{\left(j \cdot \left(y - \frac{a \cdot c}{i}\right)\right)} \cdot \left(\mathsf{neg}\left(i\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

        \[\leadsto \left(j \cdot \left(y - \color{blue}{\frac{a \cdot c}{i}}\right)\right) \cdot \left(\mathsf{neg}\left(i\right)\right) \]
      4. *-lowering-*.f6475.5

        \[\leadsto \left(j \cdot \left(y - \frac{\color{blue}{a \cdot c}}{i}\right)\right) \cdot \left(-i\right) \]
    7. Simplified75.5%

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

    if -7.9999999999999995e162 < j < 3.2999999999999998e95

    1. Initial program 76.0%

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + \left(\left(x \cdot y\right) \cdot z - \color{blue}{\left(b \cdot c\right) \cdot z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \color{blue}{\left(\mathsf{neg}\left(a \cdot x\right)\right)} + b \cdot i, z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2999999999999998e95 < j

    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 inf

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

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

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

        \[\leadsto j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) \]
      4. *-lowering-*.f6470.5

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

      \[\leadsto \color{blue}{j \cdot \left(a \cdot c - i \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.9%

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

Alternative 4: 59.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;j \leq -7.2 \cdot 10^{+111}:\\
\;\;\;\;i \cdot \left(j \cdot \left(\frac{a \cdot c}{i} - y\right)\right)\\

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

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


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

    1. Initial program 67.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 i around -inf

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

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

      \[\leadsto \color{blue}{\left(j \cdot \left(y - \frac{a \cdot c}{i}\right)\right)} \cdot \left(\mathsf{neg}\left(i\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

        \[\leadsto \left(j \cdot \left(y - \color{blue}{\frac{a \cdot c}{i}}\right)\right) \cdot \left(\mathsf{neg}\left(i\right)\right) \]
      4. *-lowering-*.f6473.0

        \[\leadsto \left(j \cdot \left(y - \frac{\color{blue}{a \cdot c}}{i}\right)\right) \cdot \left(-i\right) \]
    7. Simplified73.0%

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

    if -7.2000000000000004e111 < j < 2.94999999999999995e94

    1. Initial program 75.5%

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + \left(\left(x \cdot y\right) \cdot z - \color{blue}{\left(b \cdot c\right) \cdot z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \color{blue}{\left(\mathsf{neg}\left(a \cdot x\right)\right)} + b \cdot i, z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t, \color{blue}{b \cdot i}, z \cdot \mathsf{fma}\left(x, y, b \cdot \left(\mathsf{neg}\left(c\right)\right)\right)\right) \]
    10. Step-by-step derivation
      1. *-lowering-*.f6465.4

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

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

    if 2.94999999999999995e94 < j

    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 inf

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

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

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

        \[\leadsto j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) \]
      4. *-lowering-*.f6470.5

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

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

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

Alternative 5: 56.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 65.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 i around inf

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6466.8

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

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

    if -5.5999999999999998e132 < j < 3.40000000000000022e95

    1. Initial program 75.8%

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

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + \left(\left(x \cdot y\right) \cdot z - \color{blue}{\left(b \cdot c\right) \cdot z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \color{blue}{\left(\mathsf{neg}\left(a \cdot x\right)\right)} + b \cdot i, z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t, \color{blue}{b \cdot i}, z \cdot \mathsf{fma}\left(x, y, b \cdot \left(\mathsf{neg}\left(c\right)\right)\right)\right) \]
    10. Step-by-step derivation
      1. *-lowering-*.f6465.2

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

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

    if 3.40000000000000022e95 < j

    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 inf

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

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

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

        \[\leadsto j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) \]
      4. *-lowering-*.f6470.5

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

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

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

Alternative 6: 51.8% accurate, 2.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1e80 or 1.90000000000000007e-47 < b

    1. Initial program 74.4%

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c\right)\right) \cdot z + i \cdot t\right)} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(\mathsf{neg}\left(c \cdot z\right)\right)} + i \cdot t\right) \]
      4. remove-double-negN/A

        \[\leadsto b \cdot \left(\left(\mathsf{neg}\left(c \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)}\right) \]
      5. distribute-neg-inN/A

        \[\leadsto b \cdot \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot z + \left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)\right)} \]
      6. sub-negN/A

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right)} \]
      10. sub-negN/A

        \[\leadsto b \cdot \left(\mathsf{neg}\left(\color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i \cdot t\right)\right)\right)}\right)\right) \]
      11. distribute-neg-inN/A

        \[\leadsto b \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)\right)} \]
      12. remove-double-negN/A

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

        \[\leadsto b \cdot \color{blue}{\left(i \cdot t + \left(\mathsf{neg}\left(c \cdot z\right)\right)\right)} \]
      14. sub-negN/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{i \cdot t} - c \cdot z\right) \]
      17. *-lowering-*.f6470.9

        \[\leadsto b \cdot \left(i \cdot t - \color{blue}{c \cdot z}\right) \]
    5. Simplified70.9%

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

    if -1e80 < b < 1.90000000000000007e-47

    1. Initial program 74.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 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. *-lowering-*.f64N/A

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

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

        \[\leadsto y \cdot \left(\color{blue}{j \cdot \left(-1 \cdot i\right)} + x \cdot z\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(j, -1 \cdot i, x \cdot z\right)} \]
      5. neg-mul-1N/A

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

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

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

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

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

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

Alternative 7: 47.9% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;j \leq 1.12 \cdot 10^{+95}:\\
\;\;\;\;b \cdot \left(t \cdot i - z \cdot c\right)\\

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


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

    1. Initial program 65.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 i around inf

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6466.8

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

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

    if -6.70000000000000008e131 < j < 1.11999999999999999e95

    1. Initial program 75.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. cancel-sign-sub-invN/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c\right)\right) \cdot z + i \cdot t\right)} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(\mathsf{neg}\left(c \cdot z\right)\right)} + i \cdot t\right) \]
      4. remove-double-negN/A

        \[\leadsto b \cdot \left(\left(\mathsf{neg}\left(c \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)}\right) \]
      5. distribute-neg-inN/A

        \[\leadsto b \cdot \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot z + \left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)\right)} \]
      6. sub-negN/A

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right)} \]
      10. sub-negN/A

        \[\leadsto b \cdot \left(\mathsf{neg}\left(\color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i \cdot t\right)\right)\right)}\right)\right) \]
      11. distribute-neg-inN/A

        \[\leadsto b \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)\right)} \]
      12. remove-double-negN/A

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

        \[\leadsto b \cdot \color{blue}{\left(i \cdot t + \left(\mathsf{neg}\left(c \cdot z\right)\right)\right)} \]
      14. sub-negN/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{i \cdot t} - c \cdot z\right) \]
      17. *-lowering-*.f6452.7

        \[\leadsto b \cdot \left(i \cdot t - \color{blue}{c \cdot z}\right) \]
    5. Simplified52.7%

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

    if 1.11999999999999999e95 < j

    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 inf

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

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

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

        \[\leadsto j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) \]
      4. *-lowering-*.f6470.5

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

      \[\leadsto \color{blue}{j \cdot \left(a \cdot c - i \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.8%

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

Alternative 8: 50.1% accurate, 2.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.60000000000000058e-130 or 1.2000000000000001e-69 < b

    1. Initial program 74.4%

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c\right)\right) \cdot z + i \cdot t\right)} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(\mathsf{neg}\left(c \cdot z\right)\right)} + i \cdot t\right) \]
      4. remove-double-negN/A

        \[\leadsto b \cdot \left(\left(\mathsf{neg}\left(c \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)}\right) \]
      5. distribute-neg-inN/A

        \[\leadsto b \cdot \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot z + \left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)\right)} \]
      6. sub-negN/A

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot z - i \cdot t\right)\right)\right)} \]
      10. sub-negN/A

        \[\leadsto b \cdot \left(\mathsf{neg}\left(\color{blue}{\left(c \cdot z + \left(\mathsf{neg}\left(i \cdot t\right)\right)\right)}\right)\right) \]
      11. distribute-neg-inN/A

        \[\leadsto b \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(i \cdot t\right)\right)\right)\right)\right)} \]
      12. remove-double-negN/A

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

        \[\leadsto b \cdot \color{blue}{\left(i \cdot t + \left(\mathsf{neg}\left(c \cdot z\right)\right)\right)} \]
      14. sub-negN/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{i \cdot t} - c \cdot z\right) \]
      17. *-lowering-*.f6462.2

        \[\leadsto b \cdot \left(i \cdot t - \color{blue}{c \cdot z}\right) \]
    5. Simplified62.2%

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

    if -8.60000000000000058e-130 < b < 1.2000000000000001e-69

    1. Initial program 73.7%

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

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

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

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

        \[\leadsto a \cdot \left(\color{blue}{j \cdot c} + -1 \cdot \left(t \cdot x\right)\right) \]
      4. accelerator-lowering-fma.f64N/A

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

        \[\leadsto a \cdot \mathsf{fma}\left(j, c, \color{blue}{\mathsf{neg}\left(t \cdot x\right)}\right) \]
      6. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto a \cdot \mathsf{fma}\left(j, c, t \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
      10. neg-lowering-neg.f6443.3

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

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

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

Alternative 9: 41.8% accurate, 2.0× speedup?

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

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

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

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


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

    1. Initial program 74.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 i around inf

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6450.5

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
      3. *-lowering-*.f6438.6

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
    8. Simplified38.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot t \]
      6. *-lowering-*.f6443.4

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot t \]
    10. Applied egg-rr43.4%

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

    if -1.42e29 < b < 1.25000000000000007e62

    1. Initial program 76.5%

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

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

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

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

        \[\leadsto a \cdot \left(\color{blue}{j \cdot c} + -1 \cdot \left(t \cdot x\right)\right) \]
      4. accelerator-lowering-fma.f64N/A

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

        \[\leadsto a \cdot \mathsf{fma}\left(j, c, \color{blue}{\mathsf{neg}\left(t \cdot x\right)}\right) \]
      6. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto a \cdot \mathsf{fma}\left(j, c, t \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
      10. neg-lowering-neg.f6439.8

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

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

    if 1.25000000000000007e62 < b

    1. Initial program 67.4%

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

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

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

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

        \[\leadsto c \cdot \left(\color{blue}{j \cdot a} - b \cdot z\right) \]
      5. *-lowering-*.f6452.0

        \[\leadsto c \cdot \left(j \cdot a - \color{blue}{b \cdot z}\right) \]
    5. Simplified52.0%

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

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

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

        \[\leadsto c \cdot \left(\mathsf{neg}\left(\color{blue}{z \cdot b}\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

        \[\leadsto c \cdot \left(z \cdot \color{blue}{\left(-1 \cdot b\right)}\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto c \cdot \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      7. neg-lowering-neg.f6450.4

        \[\leadsto c \cdot \left(z \cdot \color{blue}{\left(-b\right)}\right) \]
    8. Simplified50.4%

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

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

Alternative 10: 28.8% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-221}:\\
\;\;\;\;b \cdot \left(c \cdot \left(-z\right)\right)\\

\mathbf{elif}\;x \leq 3.2 \cdot 10^{-57}:\\
\;\;\;\;b \cdot \left(t \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.35e140 or 3.2000000000000001e-57 < x

    1. Initial program 69.1%

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

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

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

        \[\leadsto y \cdot \left(\color{blue}{j \cdot \left(-1 \cdot i\right)} + x \cdot z\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(j, -1 \cdot i, x \cdot z\right)} \]
      5. neg-mul-1N/A

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(j, \mathsf{neg}\left(i\right), \color{blue}{z \cdot x}\right) \]
      8. *-lowering-*.f6455.9

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
      3. *-lowering-*.f6449.3

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
    8. Simplified49.3%

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

    if -3.35e140 < x < -8.49999999999999984e-221

    1. Initial program 80.1%

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

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

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

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

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

        \[\leadsto c \cdot \left(\color{blue}{j \cdot a} - b \cdot z\right) \]
      5. *-lowering-*.f6448.7

        \[\leadsto c \cdot \left(j \cdot a - \color{blue}{b \cdot z}\right) \]
    5. Simplified48.7%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(b \cdot \left(c \cdot z\right)\right)} \]
      2. neg-lowering-neg.f64N/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{b \cdot \left(c \cdot z\right)}\right) \]
      4. *-lowering-*.f6436.5

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

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

    if -8.49999999999999984e-221 < x < 3.2000000000000001e-57

    1. Initial program 76.0%

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

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6453.3

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
      3. *-lowering-*.f6435.4

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
    8. Simplified35.4%

      \[\leadsto \color{blue}{b \cdot \left(t \cdot i\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.35 \cdot 10^{+140}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-221}:\\ \;\;\;\;b \cdot \left(c \cdot \left(-z\right)\right)\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-57}:\\ \;\;\;\;b \cdot \left(t \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 29.4% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+80}:\\ \;\;\;\;t \cdot \left(b \cdot i\right)\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-68}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(z \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= b -2.15e+80)
   (* t (* b i))
   (if (<= b 1.5e-68) (* x (* y z)) (* c (* z (- b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -2.15e+80) {
		tmp = t * (b * i);
	} else if (b <= 1.5e-68) {
		tmp = x * (y * z);
	} else {
		tmp = c * (z * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (b <= (-2.15d+80)) then
        tmp = t * (b * i)
    else if (b <= 1.5d-68) then
        tmp = x * (y * z)
    else
        tmp = c * (z * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (b <= -2.15e+80) {
		tmp = t * (b * i);
	} else if (b <= 1.5e-68) {
		tmp = x * (y * z);
	} else {
		tmp = c * (z * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if b <= -2.15e+80:
		tmp = t * (b * i)
	elif b <= 1.5e-68:
		tmp = x * (y * z)
	else:
		tmp = c * (z * -b)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (b <= -2.15e+80)
		tmp = Float64(t * Float64(b * i));
	elseif (b <= 1.5e-68)
		tmp = Float64(x * Float64(y * z));
	else
		tmp = Float64(c * Float64(z * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (b <= -2.15e+80)
		tmp = t * (b * i);
	elseif (b <= 1.5e-68)
		tmp = x * (y * z);
	else
		tmp = c * (z * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.15e+80], N[(t * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-68], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(c * N[(z * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 79.4%

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

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6451.3

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
      3. *-lowering-*.f6444.3

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
    8. Simplified44.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot t \]
      6. *-lowering-*.f6448.5

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot t \]
    10. Applied egg-rr48.5%

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

    if -2.15000000000000002e80 < b < 1.5e-68

    1. Initial program 74.1%

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

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

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

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

        \[\leadsto y \cdot \left(\color{blue}{j \cdot \left(-1 \cdot i\right)} + x \cdot z\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(j, -1 \cdot i, x \cdot z\right)} \]
      5. neg-mul-1N/A

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(j, \mathsf{neg}\left(i\right), \color{blue}{z \cdot x}\right) \]
      8. *-lowering-*.f6454.6

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
      3. *-lowering-*.f6435.9

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
    8. Simplified35.9%

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

    if 1.5e-68 < b

    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 c around inf

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \left(\mathsf{neg}\left(\color{blue}{z \cdot b}\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

        \[\leadsto c \cdot \left(z \cdot \color{blue}{\left(-1 \cdot b\right)}\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto c \cdot \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      7. neg-lowering-neg.f6442.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+80}:\\ \;\;\;\;t \cdot \left(b \cdot i\right)\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-68}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(z \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 29.7% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+54}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+59}:\\ \;\;\;\;t \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -1.6e+54)
   (* y (* x z))
   (if (<= z 6.2e+59) (* t (* b i)) (* z (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -1.6e+54) {
		tmp = y * (x * z);
	} else if (z <= 6.2e+59) {
		tmp = t * (b * i);
	} else {
		tmp = z * (x * y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (z <= (-1.6d+54)) then
        tmp = y * (x * z)
    else if (z <= 6.2d+59) then
        tmp = t * (b * i)
    else
        tmp = z * (x * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -1.6e+54) {
		tmp = y * (x * z);
	} else if (z <= 6.2e+59) {
		tmp = t * (b * i);
	} else {
		tmp = z * (x * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -1.6e+54:
		tmp = y * (x * z)
	elif z <= 6.2e+59:
		tmp = t * (b * i)
	else:
		tmp = z * (x * y)
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -1.6e+54)
		tmp = Float64(y * Float64(x * z));
	elseif (z <= 6.2e+59)
		tmp = Float64(t * Float64(b * i));
	else
		tmp = Float64(z * Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -1.6e+54)
		tmp = y * (x * z);
	elseif (z <= 6.2e+59)
		tmp = t * (b * i);
	else
		tmp = z * (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.6e+54], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+59], N[(t * N[(b * i), $MachinePrecision]), $MachinePrecision], N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.6e54

    1. Initial program 67.4%

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

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

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

        \[\leadsto y \cdot \left(\color{blue}{j \cdot \left(-1 \cdot i\right)} + x \cdot z\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(j, -1 \cdot i, x \cdot z\right)} \]
      5. neg-mul-1N/A

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(x \cdot z\right)} \]
    8. Simplified43.0%

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

    if -1.6e54 < z < 6.20000000000000029e59

    1. Initial program 81.5%

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

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6448.2

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
      3. *-lowering-*.f6430.7

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
    8. Simplified30.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot t \]
      6. *-lowering-*.f6431.6

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot t \]
    10. Applied egg-rr31.6%

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

    if 6.20000000000000029e59 < z

    1. Initial program 65.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 t around 0

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

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

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

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

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

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

        \[\leadsto j \cdot \left(a \cdot c - i \cdot y\right) + \left(t \cdot \left(-1 \cdot \left(a \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) + \left(\left(x \cdot y\right) \cdot z - \color{blue}{\left(b \cdot c\right) \cdot z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \color{blue}{\left(\mathsf{neg}\left(a \cdot x\right)\right)} + b \cdot i, z \cdot \left(-1 \cdot \left(b \cdot c\right) + x \cdot y\right)\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(x \cdot y\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{z \cdot \left(x \cdot y\right)} \]
      4. *-lowering-*.f6452.1

        \[\leadsto z \cdot \color{blue}{\left(x \cdot y\right)} \]
    11. Simplified52.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+54}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+59}:\\ \;\;\;\;t \cdot \left(b \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 28.9% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;x \leq 3 \cdot 10^{-57}:\\
\;\;\;\;b \cdot \left(t \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4000000000000001e40 or 3.00000000000000001e-57 < x

    1. Initial program 69.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 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. *-lowering-*.f64N/A

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

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

        \[\leadsto y \cdot \left(\color{blue}{j \cdot \left(-1 \cdot i\right)} + x \cdot z\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(j, -1 \cdot i, x \cdot z\right)} \]
      5. neg-mul-1N/A

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(j, \mathsf{neg}\left(i\right), \color{blue}{z \cdot x}\right) \]
      8. *-lowering-*.f6455.8

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
      3. *-lowering-*.f6448.2

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
    8. Simplified48.2%

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

    if -1.4000000000000001e40 < x < 3.00000000000000001e-57

    1. Initial program 77.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 i around inf

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6446.5

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
      3. *-lowering-*.f6430.7

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
    8. Simplified30.7%

      \[\leadsto \color{blue}{b \cdot \left(t \cdot i\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-57}:\\ \;\;\;\;b \cdot \left(t \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 29.7% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(c \cdot j\right)\\ \mathbf{if}\;c \leq -5.6 \cdot 10^{+145}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 5.6 \cdot 10^{+52}:\\ \;\;\;\;b \cdot \left(t \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* a (* c j))))
   (if (<= c -5.6e+145) t_1 (if (<= c 5.6e+52) (* b (* t i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = a * (c * j);
	double tmp;
	if (c <= -5.6e+145) {
		tmp = t_1;
	} else if (c <= 5.6e+52) {
		tmp = b * (t * i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (c * j)
    if (c <= (-5.6d+145)) then
        tmp = t_1
    else if (c <= 5.6d+52) then
        tmp = b * (t * i)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = a * (c * j);
	double tmp;
	if (c <= -5.6e+145) {
		tmp = t_1;
	} else if (c <= 5.6e+52) {
		tmp = b * (t * i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = a * (c * j)
	tmp = 0
	if c <= -5.6e+145:
		tmp = t_1
	elif c <= 5.6e+52:
		tmp = b * (t * i)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(a * Float64(c * j))
	tmp = 0.0
	if (c <= -5.6e+145)
		tmp = t_1;
	elseif (c <= 5.6e+52)
		tmp = Float64(b * Float64(t * i));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = a * (c * j);
	tmp = 0.0;
	if (c <= -5.6e+145)
		tmp = t_1;
	elseif (c <= 5.6e+52)
		tmp = b * (t * i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.6e+145], t$95$1, If[LessEqual[c, 5.6e+52], N[(b * N[(t * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq 5.6 \cdot 10^{+52}:\\
\;\;\;\;b \cdot \left(t \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -5.5999999999999997e145 or 5.6e52 < c

    1. Initial program 66.4%

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

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

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

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

        \[\leadsto a \cdot \left(\color{blue}{j \cdot c} + -1 \cdot \left(t \cdot x\right)\right) \]
      4. accelerator-lowering-fma.f64N/A

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

        \[\leadsto a \cdot \mathsf{fma}\left(j, c, \color{blue}{\mathsf{neg}\left(t \cdot x\right)}\right) \]
      6. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto a \cdot \mathsf{fma}\left(j, c, t \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
      10. neg-lowering-neg.f6446.0

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

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

      \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
    7. Step-by-step derivation
      1. *-lowering-*.f6440.1

        \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
    8. Simplified40.1%

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

    if -5.5999999999999997e145 < c < 5.6e52

    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. Taylor expanded in i around inf

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

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

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

        \[\leadsto i \cdot \left(\color{blue}{\left(\mathsf{neg}\left(j \cdot y\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(b \cdot t\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

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

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

        \[\leadsto i \cdot \mathsf{fma}\left(j, \color{blue}{\mathsf{neg}\left(y\right)}, b \cdot t\right) \]
      11. *-lowering-*.f6447.8

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
      3. *-lowering-*.f6428.7

        \[\leadsto b \cdot \color{blue}{\left(t \cdot i\right)} \]
    8. Simplified28.7%

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

Alternative 15: 23.1% accurate, 5.5× speedup?

\[\begin{array}{l} \\ a \cdot \left(c \cdot j\right) \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* a (* c j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return a * (c * j);
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    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 = a * (c * j)
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 a * (c * j);
}
def code(x, y, z, t, a, b, c, i, j):
	return a * (c * j)
function code(x, y, z, t, a, b, c, i, j)
	return Float64(a * Float64(c * j))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = a * (c * j);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
a \cdot \left(c \cdot j\right)
\end{array}
Derivation
  1. Initial program 74.2%

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

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

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

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

      \[\leadsto a \cdot \left(\color{blue}{j \cdot c} + -1 \cdot \left(t \cdot x\right)\right) \]
    4. accelerator-lowering-fma.f64N/A

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

      \[\leadsto a \cdot \mathsf{fma}\left(j, c, \color{blue}{\mathsf{neg}\left(t \cdot x\right)}\right) \]
    6. distribute-rgt-neg-inN/A

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

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

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

      \[\leadsto a \cdot \mathsf{fma}\left(j, c, t \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
    10. neg-lowering-neg.f6431.0

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

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

    \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
  7. Step-by-step derivation
    1. *-lowering-*.f6418.4

      \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
  8. Simplified18.4%

    \[\leadsto a \cdot \color{blue}{\left(c \cdot j\right)} \]
  9. Add Preprocessing

Developer Target 1: 59.7% 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;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    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 2024198 
(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)))))