Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 74.6% → 85.1%
Time: 12.3s
Alternatives: 23
Speedup: 0.5×

Specification

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

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

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

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

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 23 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.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 85.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 71.9% accurate, 0.8× speedup?

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

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

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

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

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


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

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot b\right) \cdot z \]
      17. lower-*.f6459.3

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

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

    if -56000 < t < 3.70000000000000013e134

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.70000000000000013e134 < t < 1.7999999999999999e255

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.7999999999999999e255 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 70.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot b\right) \cdot z \]
      17. lower-*.f6459.3

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

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

    if -56000 < t < 3.70000000000000013e134

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.70000000000000013e134 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.1% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.34999999999999992e135 or 1.75e98 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999992e135 < t < -3.09999999999999992e-28

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

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

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

    if -3.09999999999999992e-28 < t < 1.75e98

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(-i\right) \cdot j\right) \cdot y + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z - a \cdot i\right) \]
      5. lift-neg.f64N/A

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(y \cdot x\right) \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right) \]
      10. associate-*l*N/A

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

        \[\leadsto \left(\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(x \cdot z\right) \cdot y\right) - b \cdot \left(c \cdot z - a \cdot i\right) \]
      12. distribute-rgt-inN/A

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

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

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

Alternative 5: 68.6% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(j \cdot t\right) \cdot c\right) - \left(c \cdot b\right) \cdot z \]
      17. lower-*.f6459.3

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

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

    if -1.75 < t < 1.75e98

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(-i\right) \cdot j\right) \cdot y + x \cdot \left(y \cdot z\right)\right) - b \cdot \left(c \cdot z - a \cdot i\right) \]
      5. lift-neg.f64N/A

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

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

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

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

        \[\leadsto \left(\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(y \cdot x\right) \cdot z\right) - b \cdot \left(c \cdot z - a \cdot i\right) \]
      10. associate-*l*N/A

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

        \[\leadsto \left(\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(x \cdot z\right) \cdot y\right) - b \cdot \left(c \cdot z - a \cdot i\right) \]
      12. distribute-rgt-inN/A

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

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

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

    if 1.75e98 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+192}:\\
\;\;\;\;\left(\left(\frac{\left(-c\right) \cdot z}{i} + a\right) \cdot i\right) \cdot b\\

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

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


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

    1. Initial program 74.6%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in i around inf

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{-1 \cdot \left(c \cdot z\right)}{i} + a\right) \cdot i\right) \cdot b \]
      7. associate-*r*N/A

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

        \[\leadsto \left(\left(\frac{\left(-1 \cdot c\right) \cdot z}{i} + a\right) \cdot i\right) \cdot b \]
      9. mul-1-negN/A

        \[\leadsto \left(\left(\frac{\left(\mathsf{neg}\left(c\right)\right) \cdot z}{i} + a\right) \cdot i\right) \cdot b \]
      10. lower-neg.f6439.7

        \[\leadsto \left(\left(\frac{\left(-c\right) \cdot z}{i} + a\right) \cdot i\right) \cdot b \]
    7. Applied rewrites39.7%

      \[\leadsto \left(\left(\frac{\left(-c\right) \cdot z}{i} + a\right) \cdot i\right) \cdot b \]

    if -4.5e192 < b < 1.74999999999999993e87

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

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

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

    if 1.74999999999999993e87 < b

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 61.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq -1.7 \cdot 10^{-82}:\\
\;\;\;\;\left(\mathsf{fma}\left(a, \frac{b}{j}, -y\right) \cdot j\right) \cdot i\\

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-259}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -4.8e-14 or 8.40000000000000041e99 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e-14 < t < -1.69999999999999988e-82

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(a, \frac{b}{j}, \mathsf{neg}\left(y\right)\right) \cdot j\right) \cdot i \]
      8. lower-neg.f6440.2

        \[\leadsto \left(\mathsf{fma}\left(a, \frac{b}{j}, -y\right) \cdot j\right) \cdot i \]
    10. Applied rewrites40.2%

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

    if -1.69999999999999988e-82 < t < -2.2999999999999999e-259

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.0

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.0%

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

    if -2.2999999999999999e-259 < t < 5e-274

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e-274 < t < 8.40000000000000041e99

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 52.7% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq -2 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-259}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

\mathbf{elif}\;t \leq 5 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.2999999999999998e-25 or 8.40000000000000041e99 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if -3.2999999999999998e-25 < t < -1.99999999999999992e-74 or -2.2999999999999999e-259 < t < 5e-274

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999992e-74 < t < -2.2999999999999999e-259

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.0

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.0%

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

    if 5e-274 < t < 8.40000000000000041e99

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 52.7% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.65e81 or 9.2e64 < a

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e81 < a < 9.2e64

    1. Initial program 74.6%

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

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

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

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

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

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

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

Alternative 10: 52.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-278}:\\
\;\;\;\;\left(i \cdot a - c \cdot z\right) \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.25000000000000006e-5 or 8.40000000000000041e99 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000006e-5 < t < -7.9999999999999996e-178

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.0

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.0%

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

    if -7.9999999999999996e-178 < t < 1.1e-278

    1. Initial program 74.6%

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

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

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

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

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

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

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

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

    if 1.1e-278 < t < 8.40000000000000041e99

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 52.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.1 \cdot 10^{-70}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

\mathbf{elif}\;t \leq 1.82 \cdot 10^{+101}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.25000000000000006e-5 or 1.82000000000000003e101 < t

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000006e-5 < t < 3.1e-70

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.0

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.0%

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

    if 3.1e-70 < t < 1.82000000000000003e101

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

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

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

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

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

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

Alternative 12: 52.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\ t_2 := \left(z \cdot y - a \cdot t\right) \cdot x\\ \mathbf{if}\;x \leq -9.6 \cdot 10^{+25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -3.15 \cdot 10^{-232}:\\ \;\;\;\;\left(j \cdot t - b \cdot z\right) \cdot c\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-278}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{-190}:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* i a) (* c z)) b)) (t_2 (* (- (* z y) (* a t)) x)))
   (if (<= x -9.6e+25)
     t_2
     (if (<= x -3.15e-232)
       (* (- (* j t) (* b z)) c)
       (if (<= x 2.15e-278)
         t_1
         (if (<= x 2.05e-190)
           (* (- (* c t) (* i y)) j)
           (if (<= x 2.5e+30) 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 = ((i * a) - (c * z)) * b;
	double t_2 = ((z * y) - (a * t)) * x;
	double tmp;
	if (x <= -9.6e+25) {
		tmp = t_2;
	} else if (x <= -3.15e-232) {
		tmp = ((j * t) - (b * z)) * c;
	} else if (x <= 2.15e-278) {
		tmp = t_1;
	} else if (x <= 2.05e-190) {
		tmp = ((c * t) - (i * y)) * j;
	} else if (x <= 2.5e+30) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
t_2 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{+25}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -3.15 \cdot 10^{-232}:\\
\;\;\;\;\left(j \cdot t - b \cdot z\right) \cdot c\\

\mathbf{elif}\;x \leq 2.15 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.05 \cdot 10^{-190}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\

\mathbf{elif}\;x \leq 2.5 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -9.59999999999999984e25 or 2.4999999999999999e30 < x

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(\mathsf{neg}\left(a\right), t \cdot x, c \cdot \left(j \cdot t\right) + y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)\right)\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, c \cdot \left(j \cdot t\right) + y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, c \cdot \left(j \cdot t\right) + y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) + c \cdot \left(j \cdot t\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot y + c \cdot \left(j \cdot t\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, \left(\left(\mathsf{neg}\left(i \cdot j\right)\right) + x \cdot z\right) \cdot y + c \cdot \left(j \cdot t\right)\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y + c \cdot \left(j \cdot t\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + z \cdot x\right) \cdot y + c \cdot \left(j \cdot t\right)\right)\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, \mathsf{fma}\left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + z \cdot x, y, c \cdot \left(j \cdot t\right)\right)\right)\right) \]
    7. Applied rewrites75.8%

      \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(-a, t \cdot x, \mathsf{fma}\left(\mathsf{fma}\left(-i, j, z \cdot x\right), y, \left(j \cdot t\right) \cdot c\right)\right)\right) \]
    8. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot \color{blue}{x} \]
      2. *-commutativeN/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      3. lower-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot \color{blue}{x} \]
      4. lift--.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      5. lift-*.f64N/A

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
      6. lift-*.f6438.6

        \[\leadsto \left(z \cdot y - a \cdot t\right) \cdot x \]
    10. Applied rewrites38.6%

      \[\leadsto \color{blue}{\left(z \cdot y - a \cdot t\right) \cdot x} \]

    if -9.59999999999999984e25 < x < -3.15000000000000005e-232

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in c around inf

      \[\leadsto \color{blue}{c \cdot \left(j \cdot t - b \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot \color{blue}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot \color{blue}{c} \]
      3. lower--.f64N/A

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot c \]
      4. lower-*.f64N/A

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot c \]
      5. lower-*.f6440.4

        \[\leadsto \left(j \cdot t - b \cdot z\right) \cdot c \]
    4. Applied rewrites40.4%

      \[\leadsto \color{blue}{\left(j \cdot t - b \cdot z\right) \cdot c} \]

    if -3.15000000000000005e-232 < x < 2.15e-278 or 2.0500000000000001e-190 < x < 2.4999999999999999e30

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]

    if 2.15e-278 < x < 2.0500000000000001e-190

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 13: 52.1% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\ \mathbf{if}\;a \leq -1.2 \cdot 10^{+123}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.3 \cdot 10^{+40}:\\ \;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{+64}:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (fma (- t) x (* i b)) a)))
   (if (<= a -1.2e+123)
     t_1
     (if (<= a -1.3e+40)
       (* (- (* y x) (* c b)) z)
       (if (<= a 9.2e+64) (* (- (* c t) (* i y)) j) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = fma(-t, x, (i * b)) * a;
	double tmp;
	if (a <= -1.2e+123) {
		tmp = t_1;
	} else if (a <= -1.3e+40) {
		tmp = ((y * x) - (c * b)) * z;
	} else if (a <= 9.2e+64) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(fma(Float64(-t), x, Float64(i * b)) * a)
	tmp = 0.0
	if (a <= -1.2e+123)
		tmp = t_1;
	elseif (a <= -1.3e+40)
		tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z);
	elseif (a <= 9.2e+64)
		tmp = Float64(Float64(Float64(c * t) - Float64(i * y)) * j);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-t) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.2e+123], t$95$1, If[LessEqual[a, -1.3e+40], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 9.2e+64], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1.3 \cdot 10^{+40}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{+64}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.19999999999999994e123 or 9.2e64 < a

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right) + \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b + \left(\color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, \color{blue}{b}, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, x \cdot \left(y \cdot z - a \cdot t\right) + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - a \cdot t\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right) \]
    4. Applied rewrites77.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\right)} \]
    5. Taylor expanded in a around inf

      \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t \cdot x\right) + b \cdot i\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right) + b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(t \cdot x\right) + b \cdot i\right) \cdot a \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot t\right) \cdot x + b \cdot i\right) \cdot a \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(t\right)\right) \cdot x + b \cdot i\right) \cdot a \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(t\right), x, b \cdot i\right) \cdot a \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-t, x, b \cdot i\right) \cdot a \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a \]
      8. lower-*.f6438.9

        \[\leadsto \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot a \]
    7. Applied rewrites38.9%

      \[\leadsto \mathsf{fma}\left(-t, x, i \cdot b\right) \cdot \color{blue}{a} \]

    if -1.19999999999999994e123 < a < -1.3e40

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.0

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.0%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]

    if -1.3e40 < a < 9.2e64

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 51.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\ \mathbf{if}\;z \leq -1.95 \cdot 10^{-66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1150:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* y x) (* c b)) z)))
   (if (<= z -1.95e-66) t_1 (if (<= z 1150.0) (* (- (* c t) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((y * x) - (c * b)) * z;
	double tmp;
	if (z <= -1.95e-66) {
		tmp = t_1;
	} else if (z <= 1150.0) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((y * x) - (c * b)) * z
    if (z <= (-1.95d-66)) then
        tmp = t_1
    else if (z <= 1150.0d0) then
        tmp = ((c * t) - (i * y)) * j
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((y * x) - (c * b)) * z;
	double tmp;
	if (z <= -1.95e-66) {
		tmp = t_1;
	} else if (z <= 1150.0) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((y * x) - (c * b)) * z
	tmp = 0
	if z <= -1.95e-66:
		tmp = t_1
	elif z <= 1150.0:
		tmp = ((c * t) - (i * y)) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(y * x) - Float64(c * b)) * z)
	tmp = 0.0
	if (z <= -1.95e-66)
		tmp = t_1;
	elseif (z <= 1150.0)
		tmp = Float64(Float64(Float64(c * t) - Float64(i * y)) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((y * x) - (c * b)) * z;
	tmp = 0.0;
	if (z <= -1.95e-66)
		tmp = t_1;
	elseif (z <= 1150.0)
		tmp = ((c * t) - (i * y)) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.95e-66], t$95$1, If[LessEqual[z, 1150.0], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1150:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.94999999999999991e-66 or 1150 < z

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(x \cdot y - b \cdot c\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot \color{blue}{z} \]
      3. lower--.f64N/A

        \[\leadsto \left(x \cdot y - b \cdot c\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot x - b \cdot c\right) \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
      7. lower-*.f6439.0

        \[\leadsto \left(y \cdot x - c \cdot b\right) \cdot z \]
    4. Applied rewrites39.0%

      \[\leadsto \color{blue}{\left(y \cdot x - c \cdot b\right) \cdot z} \]

    if -1.94999999999999991e-66 < z < 1150

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 51.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\ \mathbf{if}\;b \leq -6.2 \cdot 10^{-65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 15200000000000:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (- (* i a) (* c z)) b)))
   (if (<= b -6.2e-65)
     t_1
     (if (<= b 15200000000000.0) (* (- (* c t) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = ((i * a) - (c * z)) * b;
	double tmp;
	if (b <= -6.2e-65) {
		tmp = t_1;
	} else if (b <= 15200000000000.0) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((i * a) - (c * z)) * b
    if (b <= (-6.2d-65)) then
        tmp = t_1
    else if (b <= 15200000000000.0d0) then
        tmp = ((c * t) - (i * y)) * j
    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 = ((i * a) - (c * z)) * b;
	double tmp;
	if (b <= -6.2e-65) {
		tmp = t_1;
	} else if (b <= 15200000000000.0) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = ((i * a) - (c * z)) * b
	tmp = 0
	if b <= -6.2e-65:
		tmp = t_1
	elif b <= 15200000000000.0:
		tmp = ((c * t) - (i * y)) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(i * a) - Float64(c * z)) * b)
	tmp = 0.0
	if (b <= -6.2e-65)
		tmp = t_1;
	elseif (b <= 15200000000000.0)
		tmp = Float64(Float64(Float64(c * t) - Float64(i * y)) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = ((i * a) - (c * z)) * b;
	tmp = 0.0;
	if (b <= -6.2e-65)
		tmp = t_1;
	elseif (b <= 15200000000000.0)
		tmp = ((c * t) - (i * y)) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -6.2e-65], t$95$1, If[LessEqual[b, 15200000000000.0], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(i \cdot a - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -6.2 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 15200000000000:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.20000000000000032e-65 or 1.52e13 < b

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]

    if -6.20000000000000032e-65 < b < 1.52e13

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 41.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\left(c \cdot b\right) \cdot z\\ \mathbf{if}\;b \leq -3.4 \cdot 10^{+246}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{+161}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 3.45 \cdot 10^{+19}:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (- (* (* c b) z))))
   (if (<= b -3.4e+246)
     (* (* i b) a)
     (if (<= b -4.2e+161)
       t_1
       (if (<= b 3.45e+19) (* (- (* c t) (* i y)) j) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = -((c * b) * z);
	double tmp;
	if (b <= -3.4e+246) {
		tmp = (i * b) * a;
	} else if (b <= -4.2e+161) {
		tmp = t_1;
	} else if (b <= 3.45e+19) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -((c * b) * z)
    if (b <= (-3.4d+246)) then
        tmp = (i * b) * a
    else if (b <= (-4.2d+161)) then
        tmp = t_1
    else if (b <= 3.45d+19) then
        tmp = ((c * t) - (i * y)) * j
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = -((c * b) * z);
	double tmp;
	if (b <= -3.4e+246) {
		tmp = (i * b) * a;
	} else if (b <= -4.2e+161) {
		tmp = t_1;
	} else if (b <= 3.45e+19) {
		tmp = ((c * t) - (i * y)) * j;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = -((c * b) * z)
	tmp = 0
	if b <= -3.4e+246:
		tmp = (i * b) * a
	elif b <= -4.2e+161:
		tmp = t_1
	elif b <= 3.45e+19:
		tmp = ((c * t) - (i * y)) * j
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(-Float64(Float64(c * b) * z))
	tmp = 0.0
	if (b <= -3.4e+246)
		tmp = Float64(Float64(i * b) * a);
	elseif (b <= -4.2e+161)
		tmp = t_1;
	elseif (b <= 3.45e+19)
		tmp = Float64(Float64(Float64(c * t) - Float64(i * y)) * j);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = -((c * b) * z);
	tmp = 0.0;
	if (b <= -3.4e+246)
		tmp = (i * b) * a;
	elseif (b <= -4.2e+161)
		tmp = t_1;
	elseif (b <= 3.45e+19)
		tmp = ((c * t) - (i * y)) * j;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = (-N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision])}, If[LessEqual[b, -3.4e+246], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, -4.2e+161], t$95$1, If[LessEqual[b, 3.45e+19], N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\left(c \cdot b\right) \cdot z\\
\mathbf{if}\;b \leq -3.4 \cdot 10^{+246}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{elif}\;b \leq -4.2 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 3.45 \cdot 10^{+19}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.39999999999999988e246

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lower-*.f6422.3

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    7. Applied rewrites22.3%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]

    if -3.39999999999999988e246 < b < -4.2e161 or 3.45e19 < b

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around inf

      \[\leadsto -1 \cdot \color{blue}{\left(b \cdot \left(c \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(c \cdot z\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -b \cdot \left(c \cdot z\right) \]
      3. associate-*r*N/A

        \[\leadsto -\left(b \cdot c\right) \cdot z \]
      4. lower-*.f64N/A

        \[\leadsto -\left(b \cdot c\right) \cdot z \]
      5. *-commutativeN/A

        \[\leadsto -\left(c \cdot b\right) \cdot z \]
      6. lower-*.f6422.4

        \[\leadsto -\left(c \cdot b\right) \cdot z \]
    7. Applied rewrites22.4%

      \[\leadsto -\left(c \cdot b\right) \cdot z \]

    if -4.2e161 < b < 3.45e19

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 30.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j\\ \mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-277}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;t \leq 8.3 \cdot 10^{+102}:\\ \;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= t -1.8e-39)
   (* (* c t) j)
   (if (<= t -8.4e-178)
     (* (* z x) y)
     (if (<= t 1.12e-277)
       (* (* b a) i)
       (if (<= t 8.3e+102) (* (* (- i) y) j) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8.4e-178) {
		tmp = (z * x) * y;
	} else if (t <= 1.12e-277) {
		tmp = (b * a) * i;
	} else if (t <= 8.3e+102) {
		tmp = (-i * y) * j;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (t <= (-1.8d-39)) then
        tmp = (c * t) * j
    else if (t <= (-8.4d-178)) then
        tmp = (z * x) * y
    else if (t <= 1.12d-277) then
        tmp = (b * a) * i
    else if (t <= 8.3d+102) then
        tmp = (-i * y) * j
    else
        tmp = (j * t) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8.4e-178) {
		tmp = (z * x) * y;
	} else if (t <= 1.12e-277) {
		tmp = (b * a) * i;
	} else if (t <= 8.3e+102) {
		tmp = (-i * y) * j;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if t <= -1.8e-39:
		tmp = (c * t) * j
	elif t <= -8.4e-178:
		tmp = (z * x) * y
	elif t <= 1.12e-277:
		tmp = (b * a) * i
	elif t <= 8.3e+102:
		tmp = (-i * y) * j
	else:
		tmp = (j * t) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (t <= -1.8e-39)
		tmp = Float64(Float64(c * t) * j);
	elseif (t <= -8.4e-178)
		tmp = Float64(Float64(z * x) * y);
	elseif (t <= 1.12e-277)
		tmp = Float64(Float64(b * a) * i);
	elseif (t <= 8.3e+102)
		tmp = Float64(Float64(Float64(-i) * y) * j);
	else
		tmp = Float64(Float64(j * t) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (t <= -1.8e-39)
		tmp = (c * t) * j;
	elseif (t <= -8.4e-178)
		tmp = (z * x) * y;
	elseif (t <= 1.12e-277)
		tmp = (b * a) * i;
	elseif (t <= 8.3e+102)
		tmp = (-i * y) * j;
	else
		tmp = (j * t) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8.4e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.12e-277], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 8.3e+102], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\

\mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\

\mathbf{elif}\;t \leq 1.12 \cdot 10^{-277}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\

\mathbf{elif}\;t \leq 8.3 \cdot 10^{+102}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.8e-39

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(c \cdot t\right) \cdot j \]
    9. Step-by-step derivation
      1. lift-*.f6423.8

        \[\leadsto \left(c \cdot t\right) \cdot j \]
    10. Applied rewrites23.8%

      \[\leadsto \left(c \cdot t\right) \cdot j \]

    if -1.8e-39 < t < -8.4e-178

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \left(x \cdot \color{blue}{y}\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      6. lift-*.f64N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      7. lift-*.f6421.8

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    11. Applied rewrites21.8%

      \[\leadsto \left(z \cdot x\right) \cdot y \]

    if -8.4e-178 < t < 1.12000000000000003e-277

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right) + \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b + \left(\color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, \color{blue}{b}, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, x \cdot \left(y \cdot z - a \cdot t\right) + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - a \cdot t\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right) \]
    4. Applied rewrites77.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{i \cdot \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{i} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{i} \]
      3. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot a\right) \cdot b\right) \cdot i \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \cdot i \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + a \cdot b\right) \cdot i \]
      6. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot j\right) \cdot y + a \cdot b\right) \cdot i \]
      7. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot y + a \cdot b\right) \cdot i \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), y, a \cdot b\right) \cdot i \]
      9. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, y, a \cdot b\right) \cdot i \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i \]
      11. lower-*.f6440.2

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i \]
    7. Applied rewrites40.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(a \cdot b\right) \cdot i \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot a\right) \cdot i \]
      2. lift-*.f6422.7

        \[\leadsto \left(b \cdot a\right) \cdot i \]
    10. Applied rewrites22.7%

      \[\leadsto \left(b \cdot a\right) \cdot i \]

    if 1.12000000000000003e-277 < t < 8.3000000000000005e102

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around inf

      \[\leadsto \left(-1 \cdot \left(i \cdot y\right)\right) \cdot j \]
    9. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot y\right) \cdot j \]
      2. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot y\right) \cdot j \]
      3. lift-neg.f64N/A

        \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
      4. lower-*.f6422.4

        \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]
    10. Applied rewrites22.4%

      \[\leadsto \left(\left(-i\right) \cdot y\right) \cdot j \]

    if 8.3000000000000005e102 < t

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6423.7

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    10. Applied rewrites23.7%

      \[\leadsto \left(j \cdot t\right) \cdot c \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 18: 30.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j\\ \mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-278}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;t \leq 8.3 \cdot 10^{+102}:\\ \;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= t -1.8e-39)
   (* (* c t) j)
   (if (<= t -8.4e-178)
     (* (* z x) y)
     (if (<= t 1.05e-278)
       (* (* b a) i)
       (if (<= t 8.3e+102) (* (- i) (* j y)) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8.4e-178) {
		tmp = (z * x) * y;
	} else if (t <= 1.05e-278) {
		tmp = (b * a) * i;
	} else if (t <= 8.3e+102) {
		tmp = -i * (j * y);
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (t <= (-1.8d-39)) then
        tmp = (c * t) * j
    else if (t <= (-8.4d-178)) then
        tmp = (z * x) * y
    else if (t <= 1.05d-278) then
        tmp = (b * a) * i
    else if (t <= 8.3d+102) then
        tmp = -i * (j * y)
    else
        tmp = (j * t) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8.4e-178) {
		tmp = (z * x) * y;
	} else if (t <= 1.05e-278) {
		tmp = (b * a) * i;
	} else if (t <= 8.3e+102) {
		tmp = -i * (j * y);
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if t <= -1.8e-39:
		tmp = (c * t) * j
	elif t <= -8.4e-178:
		tmp = (z * x) * y
	elif t <= 1.05e-278:
		tmp = (b * a) * i
	elif t <= 8.3e+102:
		tmp = -i * (j * y)
	else:
		tmp = (j * t) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (t <= -1.8e-39)
		tmp = Float64(Float64(c * t) * j);
	elseif (t <= -8.4e-178)
		tmp = Float64(Float64(z * x) * y);
	elseif (t <= 1.05e-278)
		tmp = Float64(Float64(b * a) * i);
	elseif (t <= 8.3e+102)
		tmp = Float64(Float64(-i) * Float64(j * y));
	else
		tmp = Float64(Float64(j * t) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (t <= -1.8e-39)
		tmp = (c * t) * j;
	elseif (t <= -8.4e-178)
		tmp = (z * x) * y;
	elseif (t <= 1.05e-278)
		tmp = (b * a) * i;
	elseif (t <= 8.3e+102)
		tmp = -i * (j * y);
	else
		tmp = (j * t) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8.4e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.05e-278], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 8.3e+102], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\

\mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-278}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\

\mathbf{elif}\;t \leq 8.3 \cdot 10^{+102}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.8e-39

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(c \cdot t\right) \cdot j \]
    9. Step-by-step derivation
      1. lift-*.f6423.8

        \[\leadsto \left(c \cdot t\right) \cdot j \]
    10. Applied rewrites23.8%

      \[\leadsto \left(c \cdot t\right) \cdot j \]

    if -1.8e-39 < t < -8.4e-178

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \left(x \cdot \color{blue}{y}\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      6. lift-*.f64N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      7. lift-*.f6421.8

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    11. Applied rewrites21.8%

      \[\leadsto \left(z \cdot x\right) \cdot y \]

    if -8.4e-178 < t < 1.05000000000000007e-278

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right) + \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b + \left(\color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, \color{blue}{b}, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, x \cdot \left(y \cdot z - a \cdot t\right) + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - a \cdot t\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right) \]
    4. Applied rewrites77.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{i \cdot \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{i} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{i} \]
      3. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot a\right) \cdot b\right) \cdot i \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \cdot i \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + a \cdot b\right) \cdot i \]
      6. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot j\right) \cdot y + a \cdot b\right) \cdot i \]
      7. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot y + a \cdot b\right) \cdot i \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), y, a \cdot b\right) \cdot i \]
      9. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, y, a \cdot b\right) \cdot i \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i \]
      11. lower-*.f6440.2

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i \]
    7. Applied rewrites40.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(a \cdot b\right) \cdot i \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot a\right) \cdot i \]
      2. lift-*.f6422.7

        \[\leadsto \left(b \cdot a\right) \cdot i \]
    10. Applied rewrites22.7%

      \[\leadsto \left(b \cdot a\right) \cdot i \]

    if 1.05000000000000007e-278 < t < 8.3000000000000005e102

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around 0

      \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(j \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(i\right)\right) \cdot \left(j \cdot y\right) \]
      3. lift-neg.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(-i\right) \cdot \left(j \cdot \color{blue}{y}\right) \]
      5. lower-*.f6422.6

        \[\leadsto \left(-i\right) \cdot \left(j \cdot y\right) \]
    7. Applied rewrites22.6%

      \[\leadsto \left(-i\right) \cdot \color{blue}{\left(j \cdot y\right)} \]

    if 8.3000000000000005e102 < t

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6423.7

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    10. Applied rewrites23.7%

      \[\leadsto \left(j \cdot t\right) \cdot c \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 19: 30.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j\\ \mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-276}:\\ \;\;\;\;\left(b \cdot a\right) \cdot i\\ \mathbf{elif}\;t \leq 0.021:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= t -1.8e-39)
   (* (* c t) j)
   (if (<= t -8.4e-178)
     (* (* z x) y)
     (if (<= t 1.65e-276)
       (* (* b a) i)
       (if (<= t 0.021) (* (* y x) z) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8.4e-178) {
		tmp = (z * x) * y;
	} else if (t <= 1.65e-276) {
		tmp = (b * a) * i;
	} else if (t <= 0.021) {
		tmp = (y * x) * z;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (t <= (-1.8d-39)) then
        tmp = (c * t) * j
    else if (t <= (-8.4d-178)) then
        tmp = (z * x) * y
    else if (t <= 1.65d-276) then
        tmp = (b * a) * i
    else if (t <= 0.021d0) then
        tmp = (y * x) * z
    else
        tmp = (j * t) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8.4e-178) {
		tmp = (z * x) * y;
	} else if (t <= 1.65e-276) {
		tmp = (b * a) * i;
	} else if (t <= 0.021) {
		tmp = (y * x) * z;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if t <= -1.8e-39:
		tmp = (c * t) * j
	elif t <= -8.4e-178:
		tmp = (z * x) * y
	elif t <= 1.65e-276:
		tmp = (b * a) * i
	elif t <= 0.021:
		tmp = (y * x) * z
	else:
		tmp = (j * t) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (t <= -1.8e-39)
		tmp = Float64(Float64(c * t) * j);
	elseif (t <= -8.4e-178)
		tmp = Float64(Float64(z * x) * y);
	elseif (t <= 1.65e-276)
		tmp = Float64(Float64(b * a) * i);
	elseif (t <= 0.021)
		tmp = Float64(Float64(y * x) * z);
	else
		tmp = Float64(Float64(j * t) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (t <= -1.8e-39)
		tmp = (c * t) * j;
	elseif (t <= -8.4e-178)
		tmp = (z * x) * y;
	elseif (t <= 1.65e-276)
		tmp = (b * a) * i;
	elseif (t <= 0.021)
		tmp = (y * x) * z;
	else
		tmp = (j * t) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8.4e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.65e-276], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t, 0.021], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\

\mathbf{elif}\;t \leq -8.4 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{-276}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\

\mathbf{elif}\;t \leq 0.021:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.8e-39

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(c \cdot t\right) \cdot j \]
    9. Step-by-step derivation
      1. lift-*.f6423.8

        \[\leadsto \left(c \cdot t\right) \cdot j \]
    10. Applied rewrites23.8%

      \[\leadsto \left(c \cdot t\right) \cdot j \]

    if -1.8e-39 < t < -8.4e-178

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \left(x \cdot \color{blue}{y}\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      6. lift-*.f64N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      7. lift-*.f6421.8

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    11. Applied rewrites21.8%

      \[\leadsto \left(z \cdot x\right) \cdot y \]

    if -8.4e-178 < t < 1.64999999999999996e-276

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right) + \left(j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b + \left(\color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, \color{blue}{b}, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot i - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, x \cdot \left(y \cdot z - a \cdot t\right) + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - a \cdot t\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right) \]
    4. Applied rewrites77.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)\right)} \]
    5. Taylor expanded in i around inf

      \[\leadsto \color{blue}{i \cdot \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{i} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - -1 \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{i} \]
      3. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(-1 \cdot a\right) \cdot b\right) \cdot i \]
      4. mul-1-negN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot b\right) \cdot i \]
      5. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(-1 \cdot \left(j \cdot y\right) + a \cdot b\right) \cdot i \]
      6. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot j\right) \cdot y + a \cdot b\right) \cdot i \]
      7. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(j\right)\right) \cdot y + a \cdot b\right) \cdot i \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(j\right), y, a \cdot b\right) \cdot i \]
      9. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-j, y, a \cdot b\right) \cdot i \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i \]
      11. lower-*.f6440.2

        \[\leadsto \mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i \]
    7. Applied rewrites40.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, y, b \cdot a\right) \cdot i} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(a \cdot b\right) \cdot i \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot a\right) \cdot i \]
      2. lift-*.f6422.7

        \[\leadsto \left(b \cdot a\right) \cdot i \]
    10. Applied rewrites22.7%

      \[\leadsto \left(b \cdot a\right) \cdot i \]

    if 1.64999999999999996e-276 < t < 0.0210000000000000013

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if 0.0210000000000000013 < t

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6423.7

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    10. Applied rewrites23.7%

      \[\leadsto \left(j \cdot t\right) \cdot c \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 20: 30.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-274}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;t \leq 0.021:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot t\right) \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= t -1.8e-39)
   (* (* c t) j)
   (if (<= t -8e-178)
     (* (* z x) y)
     (if (<= t 2.4e-274)
       (* (* i b) a)
       (if (<= t 0.021) (* (* y x) z) (* (* j t) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8e-178) {
		tmp = (z * x) * y;
	} else if (t <= 2.4e-274) {
		tmp = (i * b) * a;
	} else if (t <= 0.021) {
		tmp = (y * x) * z;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (t <= (-1.8d-39)) then
        tmp = (c * t) * j
    else if (t <= (-8d-178)) then
        tmp = (z * x) * y
    else if (t <= 2.4d-274) then
        tmp = (i * b) * a
    else if (t <= 0.021d0) then
        tmp = (y * x) * z
    else
        tmp = (j * t) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (t <= -1.8e-39) {
		tmp = (c * t) * j;
	} else if (t <= -8e-178) {
		tmp = (z * x) * y;
	} else if (t <= 2.4e-274) {
		tmp = (i * b) * a;
	} else if (t <= 0.021) {
		tmp = (y * x) * z;
	} else {
		tmp = (j * t) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if t <= -1.8e-39:
		tmp = (c * t) * j
	elif t <= -8e-178:
		tmp = (z * x) * y
	elif t <= 2.4e-274:
		tmp = (i * b) * a
	elif t <= 0.021:
		tmp = (y * x) * z
	else:
		tmp = (j * t) * c
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (t <= -1.8e-39)
		tmp = Float64(Float64(c * t) * j);
	elseif (t <= -8e-178)
		tmp = Float64(Float64(z * x) * y);
	elseif (t <= 2.4e-274)
		tmp = Float64(Float64(i * b) * a);
	elseif (t <= 0.021)
		tmp = Float64(Float64(y * x) * z);
	else
		tmp = Float64(Float64(j * t) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (t <= -1.8e-39)
		tmp = (c * t) * j;
	elseif (t <= -8e-178)
		tmp = (z * x) * y;
	elseif (t <= 2.4e-274)
		tmp = (i * b) * a;
	elseif (t <= 0.021)
		tmp = (y * x) * z;
	else
		tmp = (j * t) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -1.8e-39], N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[t, -8e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.4e-274], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 0.021], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;\left(c \cdot t\right) \cdot j\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-274}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{elif}\;t \leq 0.021:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot t\right) \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.8e-39

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto \left(c \cdot t\right) \cdot j \]
    9. Step-by-step derivation
      1. lift-*.f6423.8

        \[\leadsto \left(c \cdot t\right) \cdot j \]
    10. Applied rewrites23.8%

      \[\leadsto \left(c \cdot t\right) \cdot j \]

    if -1.8e-39 < t < -7.9999999999999996e-178

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \left(x \cdot \color{blue}{y}\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      6. lift-*.f64N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      7. lift-*.f6421.8

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    11. Applied rewrites21.8%

      \[\leadsto \left(z \cdot x\right) \cdot y \]

    if -7.9999999999999996e-178 < t < 2.4e-274

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lower-*.f6422.3

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    7. Applied rewrites22.3%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]

    if 2.4e-274 < t < 0.0210000000000000013

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]

    if 0.0210000000000000013 < t

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6423.7

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    10. Applied rewrites23.7%

      \[\leadsto \left(j \cdot t\right) \cdot c \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 21: 30.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(j \cdot t\right) \cdot c\\ \mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-274}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{elif}\;t \leq 0.021:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (* (* j t) c)))
   (if (<= t -1.8e-39)
     t_1
     (if (<= t -8e-178)
       (* (* z x) y)
       (if (<= t 2.4e-274)
         (* (* i b) a)
         (if (<= t 0.021) (* (* y x) z) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (j * t) * c;
	double tmp;
	if (t <= -1.8e-39) {
		tmp = t_1;
	} else if (t <= -8e-178) {
		tmp = (z * x) * y;
	} else if (t <= 2.4e-274) {
		tmp = (i * b) * a;
	} else if (t <= 0.021) {
		tmp = (y * x) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (j * t) * c
    if (t <= (-1.8d-39)) then
        tmp = t_1
    else if (t <= (-8d-178)) then
        tmp = (z * x) * y
    else if (t <= 2.4d-274) then
        tmp = (i * b) * a
    else if (t <= 0.021d0) then
        tmp = (y * x) * z
    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 = (j * t) * c;
	double tmp;
	if (t <= -1.8e-39) {
		tmp = t_1;
	} else if (t <= -8e-178) {
		tmp = (z * x) * y;
	} else if (t <= 2.4e-274) {
		tmp = (i * b) * a;
	} else if (t <= 0.021) {
		tmp = (y * x) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	t_1 = (j * t) * c
	tmp = 0
	if t <= -1.8e-39:
		tmp = t_1
	elif t <= -8e-178:
		tmp = (z * x) * y
	elif t <= 2.4e-274:
		tmp = (i * b) * a
	elif t <= 0.021:
		tmp = (y * x) * z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(j * t) * c)
	tmp = 0.0
	if (t <= -1.8e-39)
		tmp = t_1;
	elseif (t <= -8e-178)
		tmp = Float64(Float64(z * x) * y);
	elseif (t <= 2.4e-274)
		tmp = Float64(Float64(i * b) * a);
	elseif (t <= 0.021)
		tmp = Float64(Float64(y * x) * z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = (j * t) * c;
	tmp = 0.0;
	if (t <= -1.8e-39)
		tmp = t_1;
	elseif (t <= -8e-178)
		tmp = (z * x) * y;
	elseif (t <= 2.4e-274)
		tmp = (i * b) * a;
	elseif (t <= 0.021)
		tmp = (y * x) * z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t, -1.8e-39], t$95$1, If[LessEqual[t, -8e-178], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 2.4e-274], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 0.021], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(j \cdot t\right) \cdot c\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-178}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-274}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{elif}\;t \leq 0.021:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.8e-39 or 0.0210000000000000013 < t

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot z - a \cdot t\right) + \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(y \cdot z - a \cdot t\right) \cdot x + \color{blue}{j} \cdot \left(c \cdot t - i \cdot y\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z - t \cdot a\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, \color{blue}{x}, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - t \cdot a, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, j \cdot \left(c \cdot t - i \cdot y\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
      14. lift-*.f6461.5

        \[\leadsto \mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right) \]
    4. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(c \cdot t - i \cdot y\right) \cdot j\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t - i \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      2. lift--.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      3. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
      5. lift-*.f6440.5

        \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j \]
    7. Applied rewrites40.5%

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot \color{blue}{j} \]
    8. Taylor expanded in y around 0

      \[\leadsto c \cdot \left(j \cdot \color{blue}{t}\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      2. lower-*.f64N/A

        \[\leadsto \left(j \cdot t\right) \cdot c \]
      3. lower-*.f6423.7

        \[\leadsto \left(j \cdot t\right) \cdot c \]
    10. Applied rewrites23.7%

      \[\leadsto \left(j \cdot t\right) \cdot c \]

    if -1.8e-39 < t < -7.9999999999999996e-178

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \left(x \cdot \color{blue}{y}\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      6. lift-*.f64N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      7. lift-*.f6421.8

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    11. Applied rewrites21.8%

      \[\leadsto \left(z \cdot x\right) \cdot y \]

    if -7.9999999999999996e-178 < t < 2.4e-274

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lower-*.f6422.3

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    7. Applied rewrites22.3%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]

    if 2.4e-274 < t < 0.0210000000000000013

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 22: 28.5% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+20}:\\ \;\;\;\;\left(z \cdot x\right) \cdot y\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+156}:\\ \;\;\;\;\left(i \cdot b\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot x\right) \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (if (<= z -4e+20)
   (* (* z x) y)
   (if (<= z 1.02e+156) (* (* i b) a) (* (* y x) z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -4e+20) {
		tmp = (z * x) * y;
	} else if (z <= 1.02e+156) {
		tmp = (i * b) * a;
	} else {
		tmp = (y * x) * z;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8) :: tmp
    if (z <= (-4d+20)) then
        tmp = (z * x) * y
    else if (z <= 1.02d+156) then
        tmp = (i * b) * a
    else
        tmp = (y * x) * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double tmp;
	if (z <= -4e+20) {
		tmp = (z * x) * y;
	} else if (z <= 1.02e+156) {
		tmp = (i * b) * a;
	} else {
		tmp = (y * x) * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j):
	tmp = 0
	if z <= -4e+20:
		tmp = (z * x) * y
	elif z <= 1.02e+156:
		tmp = (i * b) * a
	else:
		tmp = (y * x) * z
	return tmp
function code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0
	if (z <= -4e+20)
		tmp = Float64(Float64(z * x) * y);
	elseif (z <= 1.02e+156)
		tmp = Float64(Float64(i * b) * a);
	else
		tmp = Float64(Float64(y * x) * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	tmp = 0.0;
	if (z <= -4e+20)
		tmp = (z * x) * y;
	elseif (z <= 1.02e+156)
		tmp = (i * b) * a;
	else
		tmp = (y * x) * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -4e+20], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1.02e+156], N[(N[(i * b), $MachinePrecision] * a), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+156}:\\
\;\;\;\;\left(i \cdot b\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4e20

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \left(x \cdot \color{blue}{y}\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      6. lift-*.f64N/A

        \[\leadsto \left(z \cdot x\right) \cdot y \]
      7. lift-*.f6421.8

        \[\leadsto \left(z \cdot x\right) \cdot y \]
    11. Applied rewrites21.8%

      \[\leadsto \left(z \cdot x\right) \cdot y \]

    if -4e20 < z < 1.02e156

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(a \cdot i - c \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot \color{blue}{b} \]
      3. lower--.f64N/A

        \[\leadsto \left(a \cdot i - c \cdot z\right) \cdot b \]
      4. *-commutativeN/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
      6. lift-*.f6439.2

        \[\leadsto \left(i \cdot a - c \cdot z\right) \cdot b \]
    4. Applied rewrites39.2%

      \[\leadsto \color{blue}{\left(i \cdot a - c \cdot z\right) \cdot b} \]
    5. Taylor expanded in z around 0

      \[\leadsto a \cdot \color{blue}{\left(b \cdot i\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot i\right) \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(i \cdot b\right) \cdot a \]
      4. lower-*.f6422.3

        \[\leadsto \left(i \cdot b\right) \cdot a \]
    7. Applied rewrites22.3%

      \[\leadsto \left(i \cdot b\right) \cdot \color{blue}{a} \]

    if 1.02e156 < z

    1. Initial program 74.6%

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
      4. mul-1-negN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
      6. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
      8. lower-*.f6438.8

        \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    4. Applied rewrites38.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
    5. Taylor expanded in x around inf

      \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      2. lower-*.f64N/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      4. lift-*.f6421.9

        \[\leadsto \left(z \cdot y\right) \cdot x \]
    7. Applied rewrites21.9%

      \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      2. lift-*.f64N/A

        \[\leadsto \left(z \cdot y\right) \cdot x \]
      3. *-commutativeN/A

        \[\leadsto \left(y \cdot z\right) \cdot x \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
      5. associate-*r*N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot y\right) \cdot z \]
      7. *-commutativeN/A

        \[\leadsto \left(y \cdot x\right) \cdot z \]
      8. lower-*.f6421.9

        \[\leadsto \left(y \cdot x\right) \cdot z \]
    9. Applied rewrites21.9%

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 23: 21.9% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \left(y \cdot x\right) \cdot z \end{array} \]
(FPCore (x y z t a b c i j) :precision binary64 (* (* y x) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (y * x) * z;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = (y * x) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return (y * x) * z;
}
def code(x, y, z, t, a, b, c, i, j):
	return (y * x) * z
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(y * x) * z)
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = (y * x) * z;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}

\\
\left(y \cdot x\right) \cdot z
\end{array}
Derivation
  1. Initial program 74.6%

    \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
  2. Taylor expanded in y around inf

    \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right)} \]
  3. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
    2. lower-*.f64N/A

      \[\leadsto \left(-1 \cdot \left(i \cdot j\right) + x \cdot z\right) \cdot \color{blue}{y} \]
    3. associate-*r*N/A

      \[\leadsto \left(\left(-1 \cdot i\right) \cdot j + x \cdot z\right) \cdot y \]
    4. mul-1-negN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(i\right)\right) \cdot j + x \cdot z\right) \cdot y \]
    5. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(i\right), j, x \cdot z\right) \cdot y \]
    6. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-i, j, x \cdot z\right) \cdot y \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
    8. lower-*.f6438.8

      \[\leadsto \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y \]
  4. Applied rewrites38.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y} \]
  5. Taylor expanded in x around inf

    \[\leadsto x \cdot \color{blue}{\left(y \cdot z\right)} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    2. lower-*.f64N/A

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    3. *-commutativeN/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    4. lift-*.f6421.9

      \[\leadsto \left(z \cdot y\right) \cdot x \]
  7. Applied rewrites21.9%

    \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{x} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    2. lift-*.f64N/A

      \[\leadsto \left(z \cdot y\right) \cdot x \]
    3. *-commutativeN/A

      \[\leadsto \left(y \cdot z\right) \cdot x \]
    4. *-commutativeN/A

      \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
    5. associate-*r*N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    6. lower-*.f64N/A

      \[\leadsto \left(x \cdot y\right) \cdot z \]
    7. *-commutativeN/A

      \[\leadsto \left(y \cdot x\right) \cdot z \]
    8. lower-*.f6421.9

      \[\leadsto \left(y \cdot x\right) \cdot z \]
  9. Applied rewrites21.9%

    \[\leadsto \left(y \cdot x\right) \cdot z \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2025131 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))