Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A

Percentage Accurate: 90.1% → 97.1%
Time: 5.4s
Alternatives: 20
Speedup: 0.5×

Specification

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

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

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

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

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

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

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

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

Alternative 1: 97.1% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ \mathbf{if}\;2 \cdot \left(t\_1 - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(t\_1 - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \left(-z\right) \cdot \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(b, c, a\right) \cdot i}{z}, -t\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t))))
   (if (<= (* 2.0 (- t_1 (* (* (+ a (* b c)) c) i))) INFINITY)
     (* 2.0 (- t_1 (* (fma c b a) (* i c))))
     (* 2.0 (fma y x (* (- z) (fma c (/ (* (fma b c a) i) z) (- t))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if ((2.0 * (t_1 - (((a + (b * c)) * c) * i))) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_1 - (fma(c, b, a) * (i * c)));
	} else {
		tmp = 2.0 * fma(y, x, (-z * fma(c, ((fma(b, c, a) * i) / z), -t)));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(2.0 * Float64(t_1 - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) <= Inf)
		tmp = Float64(2.0 * Float64(t_1 - Float64(fma(c, b, a) * Float64(i * c))));
	else
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(-z) * fma(c, Float64(Float64(fma(b, c, a) * i) / z), Float64(-t)))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(t$95$1 - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$1 - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[((-z) * N[(c * N[(N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] / z), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;2 \cdot \left(t\_1 - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_1 - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

    if +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)))

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \left(-z\right) \cdot \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(b, c, a\right) \cdot i}{z}, \mathsf{neg}\left(t\right)\right)\right) \]
      16. lower-neg.f6485.7

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \left(-z\right) \cdot \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(b, c, a\right) \cdot i}{z}, -t\right)\right) \]
    6. Applied rewrites85.7%

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

Alternative 2: 95.8% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+246}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -4e+246)
     (* 2.0 (- (* y x) (* (fma c b a) (* i c))))
     (if (<= t_1 1e+308)
       (* 2.0 (fma y x (- (* t z) (* (* (fma c b a) c) i))))
       (* 2.0 (fma y x (fma (- c) (* (fma b c a) i) (* t z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -4e+246) {
		tmp = 2.0 * ((y * x) - (fma(c, b, a) * (i * c)));
	} else if (t_1 <= 1e+308) {
		tmp = 2.0 * fma(y, x, ((t * z) - ((fma(c, b, a) * c) * i)));
	} else {
		tmp = 2.0 * fma(y, x, fma(-c, (fma(b, c, a) * i), (t * z)));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -4e+246)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(fma(c, b, a) * Float64(i * c))));
	elseif (t_1 <= 1e+308)
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * c) * i))));
	else
		tmp = Float64(2.0 * fma(y, x, fma(Float64(-c), Float64(fma(b, c, a) * i), Float64(t * z))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+246], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+246}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000027e246

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      8. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      11. lower-fma.f6469.8

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

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot \color{blue}{c}\right)\right) \]
      10. lower-*.f6472.1

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

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

    if -4.00000000000000027e246 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

    if 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.6% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+246}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -4e+246)
     (* 2.0 (- (* y x) (* (fma c b a) (* i c))))
     (if (<= t_1 1e+308)
       (* 2.0 (fma y x (- (* t z) (* (* (fma c b a) c) i))))
       (* 2.0 (fma y x (* (- c) (* (fma b c a) i))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -4e+246) {
		tmp = 2.0 * ((y * x) - (fma(c, b, a) * (i * c)));
	} else if (t_1 <= 1e+308) {
		tmp = 2.0 * fma(y, x, ((t * z) - ((fma(c, b, a) * c) * i)));
	} else {
		tmp = 2.0 * fma(y, x, (-c * (fma(b, c, a) * i)));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -4e+246)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(fma(c, b, a) * Float64(i * c))));
	elseif (t_1 <= 1e+308)
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(fma(c, b, a) * c) * i))));
	else
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(-c) * Float64(fma(b, c, a) * i))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+246], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+246}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000027e246

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      8. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      11. lower-fma.f6469.8

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

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot \color{blue}{c}\right)\right) \]
      10. lower-*.f6472.1

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

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

    if -4.00000000000000027e246 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

    if 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \]
      10. lower-fma.f6471.2

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

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

Alternative 4: 95.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ \mathbf{if}\;2 \cdot \left(t\_1 - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq 5 \cdot 10^{+307}:\\ \;\;\;\;2 \cdot \left(t\_1 - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t))))
   (if (<= (* 2.0 (- t_1 (* (* (+ a (* b c)) c) i))) 5e+307)
     (* 2.0 (- t_1 (* (fma c b a) (* i c))))
     (* 2.0 (fma y x (fma (- c) (* (fma b c a) i) (* t z)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if ((2.0 * (t_1 - (((a + (b * c)) * c) * i))) <= 5e+307) {
		tmp = 2.0 * (t_1 - (fma(c, b, a) * (i * c)));
	} else {
		tmp = 2.0 * fma(y, x, fma(-c, (fma(b, c, a) * i), (t * z)));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(2.0 * Float64(t_1 - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) <= 5e+307)
		tmp = Float64(2.0 * Float64(t_1 - Float64(fma(c, b, a) * Float64(i * c))));
	else
		tmp = Float64(2.0 * fma(y, x, fma(Float64(-c), Float64(fma(b, c, a) * i), Float64(t * z))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(t$95$1 - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+307], N[(2.0 * N[(t$95$1 - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;2 \cdot \left(t\_1 - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \leq 5 \cdot 10^{+307}:\\
\;\;\;\;2 \cdot \left(t\_1 - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))) < 5e307

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

    if 5e307 < (*.f64 #s(literal 2 binary64) (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)))

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+246}:\\ \;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -4e+246)
     (* 2.0 (- (* y x) (* (fma c b a) (* i c))))
     (if (<= t_1 1e+308)
       (* (- (fma t z (* y x)) (* (* (fma c b a) c) i)) 2.0)
       (* 2.0 (fma y x (* (- c) (* (fma b c a) i))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -4e+246) {
		tmp = 2.0 * ((y * x) - (fma(c, b, a) * (i * c)));
	} else if (t_1 <= 1e+308) {
		tmp = (fma(t, z, (y * x)) - ((fma(c, b, a) * c) * i)) * 2.0;
	} else {
		tmp = 2.0 * fma(y, x, (-c * (fma(b, c, a) * i)));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -4e+246)
		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(fma(c, b, a) * Float64(i * c))));
	elseif (t_1 <= 1e+308)
		tmp = Float64(Float64(fma(t, z, Float64(y * x)) - Float64(Float64(fma(c, b, a) * c) * i)) * 2.0);
	else
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(-c) * Float64(fma(b, c, a) * i))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+246], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(y * x + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+246}:\\
\;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000027e246

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      8. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      11. lower-fma.f6469.8

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

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot \color{blue}{c}\right)\right) \]
      10. lower-*.f6472.1

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

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

    if -4.00000000000000027e246 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right)\right) \]
      10. lower-fma.f6471.2

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

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

Alternative 6: 89.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+180}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(i \cdot c\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* y x) (* (fma c b a) (* i c)))))
        (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+180)
     t_1
     (if (<= t_2 2e+110) (* 2.0 (fma y x (- (* t z) (* (* i c) a)))) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((y * x) - (fma(c, b, a) * (i * c)));
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+180) {
		tmp = t_1;
	} else if (t_2 <= 2e+110) {
		tmp = 2.0 * fma(y, x, ((t * z) - ((i * c) * a)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(fma(c, b, a) * Float64(i * c))))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -5e+180)
		tmp = t_1;
	elseif (t_2 <= 2e+110)
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(t * z) - Float64(Float64(i * c) * a))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+180], t$95$1, If[LessEqual[t$95$2, 2e+110], N[(2.0 * N[(y * x + N[(N[(t * z), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999996e180 or 2e110 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      8. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      11. lower-fma.f6469.8

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

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot \color{blue}{c}\right)\right) \]
      10. lower-*.f6472.1

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

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

    if -4.9999999999999996e180 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e110

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - a \cdot \left(c \cdot i\right)}\right) \]
    5. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(i \cdot c\right) \cdot a\right) \]
      6. lift-*.f6474.6

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

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

Alternative 7: 89.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+180}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* y x) (* (fma c b a) (* i c)))))
        (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -5e+180)
     t_1
     (if (<= t_2 2e+110) (* 2.0 (- (fma t z (* y x)) (* (* i c) a))) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((y * x) - (fma(c, b, a) * (i * c)));
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -5e+180) {
		tmp = t_1;
	} else if (t_2 <= 2e+110) {
		tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(fma(c, b, a) * Float64(i * c))))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -5e+180)
		tmp = t_1;
	elseif (t_2 <= 2e+110)
		tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+180], t$95$1, If[LessEqual[t$95$2, 2e+110], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999996e180 or 2e110 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      8. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      11. lower-fma.f6469.8

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

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot b + a\right) \cdot \left(c \cdot i\right)\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot \color{blue}{c}\right)\right) \]
      10. lower-*.f6472.1

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

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

    if -4.9999999999999996e180 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e110

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right) \]
      8. lower-*.f6474.0

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

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

Alternative 8: 86.5% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{if}\;c \leq -5.6 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 9.5 \cdot 10^{+82}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* y x) (* (* (fma c b a) i) c)))))
   (if (<= c -5.6e-31)
     t_1
     (if (<= c 9.5e+82) (* 2.0 (- (fma t z (* y x)) (* (* i c) a))) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((y * x) - ((fma(c, b, a) * i) * c));
	double tmp;
	if (c <= -5.6e-31) {
		tmp = t_1;
	} else if (c <= 9.5e+82) {
		tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c)))
	tmp = 0.0
	if (c <= -5.6e-31)
		tmp = t_1;
	elseif (c <= 9.5e+82)
		tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.6e-31], t$95$1, If[LessEqual[c, 9.5e+82], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{if}\;c \leq -5.6 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -5.5999999999999998e-31 or 9.50000000000000049e82 < c

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      8. +-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. lower-fma.f6469.8

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

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

    if -5.5999999999999998e-31 < c < 9.50000000000000049e82

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right) \]
      8. lower-*.f6474.0

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

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

Alternative 9: 82.4% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(i \cdot c\right) \cdot a\\ t_2 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ t_3 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_3 \leq -1 \cdot 10^{+307}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+82}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+298}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, -t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* i c) a))
        (t_2 (* -2.0 (* (* (fma c b a) i) c)))
        (t_3 (* (* (+ a (* b c)) c) i)))
   (if (<= t_3 -1e+307)
     t_2
     (if (<= t_3 -2e+82)
       (* 2.0 (- (* x y) t_1))
       (if (<= t_3 2e+110)
         (* (fma y x (* t z)) 2.0)
         (if (<= t_3 2e+298) (* 2.0 (fma y x (- t_1))) t_2))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (i * c) * a;
	double t_2 = -2.0 * ((fma(c, b, a) * i) * c);
	double t_3 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_3 <= -1e+307) {
		tmp = t_2;
	} else if (t_3 <= -2e+82) {
		tmp = 2.0 * ((x * y) - t_1);
	} else if (t_3 <= 2e+110) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else if (t_3 <= 2e+298) {
		tmp = 2.0 * fma(y, x, -t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(i * c) * a)
	t_2 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c))
	t_3 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_3 <= -1e+307)
		tmp = t_2;
	elseif (t_3 <= -2e+82)
		tmp = Float64(2.0 * Float64(Float64(x * y) - t_1));
	elseif (t_3 <= 2e+110)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	elseif (t_3 <= 2e+298)
		tmp = Float64(2.0 * fma(y, x, Float64(-t_1)));
	else
		tmp = t_2;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+307], t$95$2, If[LessEqual[t$95$3, -2e+82], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+110], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 2e+298], N[(2.0 * N[(y * x + (-t$95$1)), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(i \cdot c\right) \cdot a\\
t_2 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_3 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+82}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, -t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999986e306 or 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      6. +-commutativeN/A

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

        \[\leadsto -2 \cdot \left(\left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      8. lower-fma.f6447.5

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

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

    if -9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e82

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right) \]
      8. lift-*.f6474.0

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

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

      \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{a \cdot \left(c \cdot i\right)}\right) \]
    8. Step-by-step derivation
      1. lower--.f64N/A

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - \left(c \cdot i\right) \cdot a\right) \]
      4. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(x \cdot y - \left(i \cdot c\right) \cdot a\right) \]
      6. lift-*.f6450.2

        \[\leadsto 2 \cdot \left(x \cdot y - \left(i \cdot c\right) \cdot a\right) \]
    9. Applied rewrites50.2%

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

    if -1.9999999999999999e82 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e110

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

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

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

    if 2e110 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      8. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. *-commutativeN/A

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(b \cdot c + a\right) \cdot i\right) \cdot c\right) \]
      11. lower-fma.f6469.8

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, -\left(i \cdot c\right) \cdot a\right) \]
      9. lower-*.f6450.8

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

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

Alternative 10: 82.4% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ t_3 := 2 \cdot \left(x \cdot y - \left(i \cdot c\right) \cdot a\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+307}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+82}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* (* (fma c b a) i) c)))
        (t_2 (* (* (+ a (* b c)) c) i))
        (t_3 (* 2.0 (- (* x y) (* (* i c) a)))))
   (if (<= t_2 -1e+307)
     t_1
     (if (<= t_2 -2e+82)
       t_3
       (if (<= t_2 2e+110)
         (* (fma y x (* t z)) 2.0)
         (if (<= t_2 2e+298) t_3 t_1))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -2.0 * ((fma(c, b, a) * i) * c);
	double t_2 = ((a + (b * c)) * c) * i;
	double t_3 = 2.0 * ((x * y) - ((i * c) * a));
	double tmp;
	if (t_2 <= -1e+307) {
		tmp = t_1;
	} else if (t_2 <= -2e+82) {
		tmp = t_3;
	} else if (t_2 <= 2e+110) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else if (t_2 <= 2e+298) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	t_3 = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(i * c) * a)))
	tmp = 0.0
	if (t_2 <= -1e+307)
		tmp = t_1;
	elseif (t_2 <= -2e+82)
		tmp = t_3;
	elseif (t_2 <= 2e+110)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	elseif (t_2 <= 2e+298)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+307], t$95$1, If[LessEqual[t$95$2, -2e+82], t$95$3, If[LessEqual[t$95$2, 2e+110], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+298], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
t_3 := 2 \cdot \left(x \cdot y - \left(i \cdot c\right) \cdot a\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+307}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+82}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999986e306 or 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      6. +-commutativeN/A

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

        \[\leadsto -2 \cdot \left(\left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      8. lower-fma.f6447.5

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

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

    if -9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e82 or 2e110 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \mathsf{fma}\left(c, b, a\right) \cdot \color{blue}{\left(i \cdot c\right)}\right) \]
      11. lower-*.f6494.1

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right) \]
      8. lift-*.f6474.0

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

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

      \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{a \cdot \left(c \cdot i\right)}\right) \]
    8. Step-by-step derivation
      1. lower--.f64N/A

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - \left(c \cdot i\right) \cdot a\right) \]
      4. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(x \cdot y - \left(i \cdot c\right) \cdot a\right) \]
      6. lift-*.f6450.2

        \[\leadsto 2 \cdot \left(x \cdot y - \left(i \cdot c\right) \cdot a\right) \]
    9. Applied rewrites50.2%

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

    if -1.9999999999999999e82 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e110

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

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

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

Alternative 11: 81.3% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ t_2 := \left(a + b \cdot c\right) \cdot c\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* y x) (* (* (fma c b a) i) c))))
        (t_2 (* (+ a (* b c)) c)))
   (if (<= t_2 -5e-28)
     t_1
     (if (<= t_2 2e+148) (* (fma y x (* t z)) 2.0) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((y * x) - ((fma(c, b, a) * i) * c));
	double t_2 = (a + (b * c)) * c;
	double tmp;
	if (t_2 <= -5e-28) {
		tmp = t_1;
	} else if (t_2 <= 2e+148) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(Float64(fma(c, b, a) * i) * c)))
	t_2 = Float64(Float64(a + Float64(b * c)) * c)
	tmp = 0.0
	if (t_2 <= -5e-28)
		tmp = t_1;
	elseif (t_2 <= 2e+148)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-28], t$95$1, If[LessEqual[t$95$2, 2e+148], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(a + b \cdot c\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -5.0000000000000002e-28 or 2.0000000000000001e148 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      8. +-commutativeN/A

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

        \[\leadsto 2 \cdot \left(y \cdot x - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      10. lower-fma.f6469.8

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

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

    if -5.0000000000000002e-28 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e148

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

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

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

Alternative 12: 80.6% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+268}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+173}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* (* (fma c b a) i) c))) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -2e+268)
     t_1
     (if (<= t_2 1e+173) (* (fma y x (* t z)) 2.0) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -2.0 * ((fma(c, b, a) * i) * c);
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -2e+268) {
		tmp = t_1;
	} else if (t_2 <= 1e+173) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c))
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -2e+268)
		tmp = t_1;
	elseif (t_2 <= 1e+173)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+268], t$95$1, If[LessEqual[t$95$2, 1e+173], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+268}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+173}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e268 or 1e173 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot c\right) \]
      6. +-commutativeN/A

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

        \[\leadsto -2 \cdot \left(\left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
      8. lower-fma.f6447.5

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

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

    if -1.9999999999999999e268 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e173

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

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

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

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

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

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

Alternative 13: 74.1% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+307}:\\ \;\;\;\;\left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -1e+307)
     (* (* c (* (* i c) b)) -2.0)
     (if (<= t_1 2e+157)
       (* (fma y x (* t z)) 2.0)
       (* (* (* c (* i c)) b) -2.0)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -1e+307) {
		tmp = (c * ((i * c) * b)) * -2.0;
	} else if (t_1 <= 2e+157) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else {
		tmp = ((c * (i * c)) * b) * -2.0;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -1e+307)
		tmp = Float64(Float64(c * Float64(Float64(i * c) * b)) * -2.0);
	elseif (t_1 <= 2e+157)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	else
		tmp = Float64(Float64(Float64(c * Float64(i * c)) * b) * -2.0);
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+307], N[(N[(c * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+157], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(c * N[(i * c), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+307}:\\
\;\;\;\;\left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999986e306

    1. Initial program 90.1%

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

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

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

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

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      6. unpow2N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      7. lower-*.f6433.2

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
    4. Applied rewrites33.2%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      6. lift-*.f6434.1

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    6. Applied rewrites34.1%

      \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      6. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      7. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      8. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      9. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      10. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      11. lift-*.f6434.0

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
    8. Applied rewrites34.0%

      \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot \color{blue}{-2} \]

    if -9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999997e157

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      2. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\color{blue}{x \cdot y} + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      3. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      5. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      7. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      8. associate--l+N/A

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right)} \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\color{blue}{y \cdot x} + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      11. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      13. lower--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      14. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      15. lift-+.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      16. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      17. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
    3. Applied rewrites91.6%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) \]
      2. lift--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)} \cdot i\right) \]
      5. lift-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot b + a\right) \cdot \left(c \cdot i\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot i\right) \cdot \left(c \cdot b + a\right)}\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \left(\color{blue}{b \cdot c} + a\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \color{blue}{\left(a + b \cdot c\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      11. fp-cancel-sub-sign-invN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z + \left(\mathsf{neg}\left(c\right)\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      12. mul-1-negN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{\left(-1 \cdot c\right)} \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)}\right) \]
      14. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) + t \cdot z}\right) \]
      15. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\left(-1 \cdot c\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)} + t \cdot z\right) \]
      16. lower-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-1 \cdot c, i \cdot \left(a + b \cdot c\right), t \cdot z\right)}\right) \]
    5. Applied rewrites92.8%

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      2. lift-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, \color{blue}{t \cdot z}\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \color{blue}{\left(\left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)}\right) \]
      5. lift-neg.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\color{blue}{\left(\mathsf{neg}\left(c\right)\right)} \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \color{blue}{\left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)} + t \cdot z\right)\right) \]
      7. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right) + t \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(z, t, x \cdot y\right) - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right) \cdot 2} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{2} \cdot \left(t \cdot z + x \cdot y\right) \]
      2. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      3. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      4. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      10. lower-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      11. +-commutativeN/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
    10. Applied rewrites55.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2} \]

    if 1.99999999999999997e157 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      6. unpow2N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      7. lower-*.f6433.2

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
    4. Applied rewrites33.2%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      6. lift-*.f6434.1

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    6. Applied rewrites34.1%

      \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 73.8% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+307}:\\ \;\;\;\;\left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+298}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)))
   (if (<= t_1 -1e+307)
     (* (* c (* (* i c) b)) -2.0)
     (if (<= t_1 2e+298)
       (* (fma y x (* t z)) 2.0)
       (* (* (* c c) (* i b)) -2.0)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_1 <= -1e+307) {
		tmp = (c * ((i * c) * b)) * -2.0;
	} else if (t_1 <= 2e+298) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else {
		tmp = ((c * c) * (i * b)) * -2.0;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_1 <= -1e+307)
		tmp = Float64(Float64(c * Float64(Float64(i * c) * b)) * -2.0);
	elseif (t_1 <= 2e+298)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	else
		tmp = Float64(Float64(Float64(c * c) * Float64(i * b)) * -2.0);
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+307], N[(N[(c * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+298], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(c * c), $MachinePrecision] * N[(i * b), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+307}:\\
\;\;\;\;\left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

\mathbf{else}:\\
\;\;\;\;\left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999986e306

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      6. unpow2N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      7. lower-*.f6433.2

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
    4. Applied rewrites33.2%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      6. lift-*.f6434.1

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    6. Applied rewrites34.1%

      \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      6. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      7. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      8. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      9. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      10. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      11. lift-*.f6434.0

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
    8. Applied rewrites34.0%

      \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot \color{blue}{-2} \]

    if -9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      2. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\color{blue}{x \cdot y} + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      3. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      5. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      7. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      8. associate--l+N/A

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right)} \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\color{blue}{y \cdot x} + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      11. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      13. lower--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      14. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      15. lift-+.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      16. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      17. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
    3. Applied rewrites91.6%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) \]
      2. lift--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)} \cdot i\right) \]
      5. lift-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot b + a\right) \cdot \left(c \cdot i\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot i\right) \cdot \left(c \cdot b + a\right)}\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \left(\color{blue}{b \cdot c} + a\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \color{blue}{\left(a + b \cdot c\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      11. fp-cancel-sub-sign-invN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z + \left(\mathsf{neg}\left(c\right)\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      12. mul-1-negN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{\left(-1 \cdot c\right)} \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)}\right) \]
      14. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) + t \cdot z}\right) \]
      15. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\left(-1 \cdot c\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)} + t \cdot z\right) \]
      16. lower-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-1 \cdot c, i \cdot \left(a + b \cdot c\right), t \cdot z\right)}\right) \]
    5. Applied rewrites92.8%

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      2. lift-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, \color{blue}{t \cdot z}\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \color{blue}{\left(\left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)}\right) \]
      5. lift-neg.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\color{blue}{\left(\mathsf{neg}\left(c\right)\right)} \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \color{blue}{\left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)} + t \cdot z\right)\right) \]
      7. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right) + t \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(z, t, x \cdot y\right) - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right) \cdot 2} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{2} \cdot \left(t \cdot z + x \cdot y\right) \]
      2. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      3. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      4. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      10. lower-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      11. +-commutativeN/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
    10. Applied rewrites55.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2} \]

    if 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      6. unpow2N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      7. lower-*.f6433.2

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
    4. Applied rewrites33.2%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      4. pow2N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      5. associate-*l*N/A

        \[\leadsto \left({c}^{2} \cdot \left(i \cdot b\right)\right) \cdot -2 \]
      6. *-commutativeN/A

        \[\leadsto \left({c}^{2} \cdot \left(b \cdot i\right)\right) \cdot -2 \]
      7. lower-*.f64N/A

        \[\leadsto \left({c}^{2} \cdot \left(b \cdot i\right)\right) \cdot -2 \]
      8. pow2N/A

        \[\leadsto \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right) \cdot -2 \]
      9. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right) \cdot -2 \]
      10. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2 \]
      11. lower-*.f6431.9

        \[\leadsto \left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2 \]
    6. Applied rewrites31.9%

      \[\leadsto \left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2 \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 73.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+307}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* c (* (* i c) b)) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -1e+307)
     t_1
     (if (<= t_2 2e+298) (* (fma y x (* t z)) 2.0) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * ((i * c) * b)) * -2.0;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -1e+307) {
		tmp = t_1;
	} else if (t_2 <= 2e+298) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * Float64(Float64(i * c) * b)) * -2.0)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -1e+307)
		tmp = t_1;
	elseif (t_2 <= 2e+298)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+307], t$95$1, If[LessEqual[t$95$2, 2e+298], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+307}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999986e306 or 1.9999999999999999e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left({c}^{2} \cdot i\right) \cdot b\right) \cdot -2 \]
      6. unpow2N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      7. lower-*.f6433.2

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
    4. Applied rewrites33.2%

      \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot b\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      6. lift-*.f6434.1

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    6. Applied rewrites34.1%

      \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(c \cdot \left(i \cdot c\right)\right) \cdot b\right) \cdot -2 \]
      3. associate-*l*N/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      6. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      7. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2 \]
      8. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      9. lower-*.f64N/A

        \[\leadsto \left(c \cdot \left(\left(c \cdot i\right) \cdot b\right)\right) \cdot -2 \]
      10. *-commutativeN/A

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
      11. lift-*.f6434.0

        \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot -2 \]
    8. Applied rewrites34.0%

      \[\leadsto \left(c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot \color{blue}{-2} \]

    if -9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      2. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\color{blue}{x \cdot y} + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      3. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      5. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      7. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      8. associate--l+N/A

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right)} \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\color{blue}{y \cdot x} + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      11. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      13. lower--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      14. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      15. lift-+.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      16. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      17. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
    3. Applied rewrites91.6%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) \]
      2. lift--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)} \cdot i\right) \]
      5. lift-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot b + a\right) \cdot \left(c \cdot i\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot i\right) \cdot \left(c \cdot b + a\right)}\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \left(\color{blue}{b \cdot c} + a\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \color{blue}{\left(a + b \cdot c\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      11. fp-cancel-sub-sign-invN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z + \left(\mathsf{neg}\left(c\right)\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      12. mul-1-negN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{\left(-1 \cdot c\right)} \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)}\right) \]
      14. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) + t \cdot z}\right) \]
      15. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\left(-1 \cdot c\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)} + t \cdot z\right) \]
      16. lower-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-1 \cdot c, i \cdot \left(a + b \cdot c\right), t \cdot z\right)}\right) \]
    5. Applied rewrites92.8%

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      2. lift-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, \color{blue}{t \cdot z}\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \color{blue}{\left(\left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)}\right) \]
      5. lift-neg.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\color{blue}{\left(\mathsf{neg}\left(c\right)\right)} \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \color{blue}{\left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)} + t \cdot z\right)\right) \]
      7. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right) + t \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(z, t, x \cdot y\right) - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right) \cdot 2} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{2} \cdot \left(t \cdot z + x \cdot y\right) \]
      2. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      3. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      4. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      10. lower-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      11. +-commutativeN/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
    10. Applied rewrites55.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 62.6% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+268}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+173}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -2e+268)
     t_1
     (if (<= t_2 1e+173) (* (fma y x (* t z)) 2.0) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((i * c) * a) * -2.0;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -2e+268) {
		tmp = t_1;
	} else if (t_2 <= 1e+173) {
		tmp = fma(y, x, (t * z)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(i * c) * a) * -2.0)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -2e+268)
		tmp = t_1;
	elseif (t_2 <= 1e+173)
		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+268], t$95$1, If[LessEqual[t$95$2, 1e+173], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+268}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+173}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e268 or 1e173 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6425.2

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites25.2%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]

    if -1.9999999999999999e268 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e173

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      2. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(\color{blue}{x \cdot y} + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      3. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      5. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      7. lift-+.f64N/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      8. associate--l+N/A

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right)} \]
      9. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\color{blue}{y \cdot x} + \left(z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, z \cdot t - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      11. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      12. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      13. lower--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      14. lower-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      15. lift-+.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(a + b \cdot c\right)} \cdot c\right) \cdot i\right) \]
      16. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\left(a + \color{blue}{b \cdot c}\right) \cdot c\right) \cdot i\right) \]
      17. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right)} \cdot i\right) \]
      18. lift-*.f6491.6

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
    3. Applied rewrites91.6%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(y, x, t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z} - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) \]
      2. lift--.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i}\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)} \cdot i\right) \]
      5. lift-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(\color{blue}{\left(c \cdot b + a\right)} \cdot c\right) \cdot i\right) \]
      6. associate-*l*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot b + a\right) \cdot \left(c \cdot i\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{\left(c \cdot i\right) \cdot \left(c \cdot b + a\right)}\right) \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \left(\color{blue}{b \cdot c} + a\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \left(c \cdot i\right) \cdot \color{blue}{\left(a + b \cdot c\right)}\right) \]
      10. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      11. fp-cancel-sub-sign-invN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{t \cdot z + \left(\mathsf{neg}\left(c\right)\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right) \]
      12. mul-1-negN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{\left(-1 \cdot c\right)} \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, t \cdot z + \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)}\right) \]
      14. +-commutativeN/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) + t \cdot z}\right) \]
      15. associate-*r*N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\left(-1 \cdot c\right) \cdot \left(i \cdot \left(a + b \cdot c\right)\right)} + t \cdot z\right) \]
      16. lower-fma.f64N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-1 \cdot c, i \cdot \left(a + b \cdot c\right), t \cdot z\right)}\right) \]
    5. Applied rewrites92.8%

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      2. lift-fma.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, t \cdot z\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, \color{blue}{t \cdot z}\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \color{blue}{\left(\left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)}\right) \]
      5. lift-neg.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\color{blue}{\left(\mathsf{neg}\left(c\right)\right)} \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) + t \cdot z\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \color{blue}{\left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)} + t \cdot z\right)\right) \]
      7. lift-fma.f64N/A

        \[\leadsto 2 \cdot \left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right) + t \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(\mathsf{neg}\left(c\right)\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) + t \cdot z\right)\right) \cdot 2} \]
    7. Applied rewrites91.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(z, t, x \cdot y\right) - \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right) \cdot c\right) \cdot 2} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{2} \cdot \left(t \cdot z + x \cdot y\right) \]
      2. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      3. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      4. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      7. +-commutativeN/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      8. associate-*l*N/A

        \[\leadsto 2 \cdot \left(t \cdot z + x \cdot y\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      10. lower-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      11. +-commutativeN/A

        \[\leadsto \left(x \cdot y + t \cdot z\right) \cdot 2 \]
      12. *-commutativeN/A

        \[\leadsto \left(y \cdot x + t \cdot z\right) \cdot 2 \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
      14. lift-*.f6455.3

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2 \]
    10. Applied rewrites55.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 62.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+268}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+173}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
   (if (<= t_2 -2e+268)
     t_1
     (if (<= t_2 1e+173) (* (fma t z (* y x)) 2.0) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((i * c) * a) * -2.0;
	double t_2 = ((a + (b * c)) * c) * i;
	double tmp;
	if (t_2 <= -2e+268) {
		tmp = t_1;
	} else if (t_2 <= 1e+173) {
		tmp = fma(t, z, (y * x)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(i * c) * a) * -2.0)
	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	tmp = 0.0
	if (t_2 <= -2e+268)
		tmp = t_1;
	elseif (t_2 <= 1e+173)
		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+268], t$95$1, If[LessEqual[t$95$2, 1e+173], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+268}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+173}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e268 or 1e173 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6425.2

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites25.2%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]

    if -1.9999999999999999e268 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e173

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in c around 0

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(t \cdot z + x \cdot y\right) \cdot \color{blue}{2} \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t, z, x \cdot y\right) \cdot 2 \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2 \]
      5. lower-*.f6455.2

        \[\leadsto \mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2 \]
    4. Applied rewrites55.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 44.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(t + t\right) \cdot z\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq -5 \cdot 10^{-242}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\left(x + x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ t t) z)))
   (if (<= (* z t) -1e+82)
     t_1
     (if (<= (* z t) -5e-242)
       (* (* (* i c) a) -2.0)
       (if (<= (* z t) 5e+133) (* (+ x x) y) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (t + t) * z;
	double tmp;
	if ((z * t) <= -1e+82) {
		tmp = t_1;
	} else if ((z * t) <= -5e-242) {
		tmp = ((i * c) * a) * -2.0;
	} else if ((z * t) <= 5e+133) {
		tmp = (x + x) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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)
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) :: t_1
    real(8) :: tmp
    t_1 = (t + t) * z
    if ((z * t) <= (-1d+82)) then
        tmp = t_1
    else if ((z * t) <= (-5d-242)) then
        tmp = ((i * c) * a) * (-2.0d0)
    else if ((z * t) <= 5d+133) then
        tmp = (x + x) * y
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (t + t) * z;
	double tmp;
	if ((z * t) <= -1e+82) {
		tmp = t_1;
	} else if ((z * t) <= -5e-242) {
		tmp = ((i * c) * a) * -2.0;
	} else if ((z * t) <= 5e+133) {
		tmp = (x + x) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = (t + t) * z
	tmp = 0
	if (z * t) <= -1e+82:
		tmp = t_1
	elif (z * t) <= -5e-242:
		tmp = ((i * c) * a) * -2.0
	elif (z * t) <= 5e+133:
		tmp = (x + x) * y
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(t + t) * z)
	tmp = 0.0
	if (Float64(z * t) <= -1e+82)
		tmp = t_1;
	elseif (Float64(z * t) <= -5e-242)
		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
	elseif (Float64(z * t) <= 5e+133)
		tmp = Float64(Float64(x + x) * y);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (t + t) * z;
	tmp = 0.0;
	if ((z * t) <= -1e+82)
		tmp = t_1;
	elseif ((z * t) <= -5e-242)
		tmp = ((i * c) * a) * -2.0;
	elseif ((z * t) <= 5e+133)
		tmp = (x + x) * y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+82], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -5e-242], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+133], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(t + t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq -5 \cdot 10^{-242}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\left(x + x\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -9.9999999999999996e81 or 4.99999999999999961e133 < (*.f64 z t)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in z around inf

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot t\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot t\right) \cdot \color{blue}{z} \]
      3. count-2-revN/A

        \[\leadsto \left(t + t\right) \cdot z \]
      4. lower-+.f6428.7

        \[\leadsto \left(t + t\right) \cdot z \]
    4. Applied rewrites28.7%

      \[\leadsto \color{blue}{\left(t + t\right) \cdot z} \]

    if -9.9999999999999996e81 < (*.f64 z t) < -4.9999999999999998e-242

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot \color{blue}{-2} \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(c \cdot i\right) \cdot a\right) \cdot -2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      6. lower-*.f6425.2

        \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
    4. Applied rewrites25.2%

      \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]

    if -4.9999999999999998e-242 < (*.f64 z t) < 4.99999999999999961e133

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      3. count-2-revN/A

        \[\leadsto \left(x + x\right) \cdot y \]
      4. lower-+.f6429.6

        \[\leadsto \left(x + x\right) \cdot y \]
    4. Applied rewrites29.6%

      \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 42.2% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(t + t\right) \cdot z\\ \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+76}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\left(x + x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ t t) z)))
   (if (<= (* z t) -2e+76) t_1 (if (<= (* z t) 5e+133) (* (+ x x) y) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (t + t) * z;
	double tmp;
	if ((z * t) <= -2e+76) {
		tmp = t_1;
	} else if ((z * t) <= 5e+133) {
		tmp = (x + x) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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)
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) :: t_1
    real(8) :: tmp
    t_1 = (t + t) * z
    if ((z * t) <= (-2d+76)) then
        tmp = t_1
    else if ((z * t) <= 5d+133) then
        tmp = (x + x) * y
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (t + t) * z;
	double tmp;
	if ((z * t) <= -2e+76) {
		tmp = t_1;
	} else if ((z * t) <= 5e+133) {
		tmp = (x + x) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = (t + t) * z
	tmp = 0
	if (z * t) <= -2e+76:
		tmp = t_1
	elif (z * t) <= 5e+133:
		tmp = (x + x) * y
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(t + t) * z)
	tmp = 0.0
	if (Float64(z * t) <= -2e+76)
		tmp = t_1;
	elseif (Float64(z * t) <= 5e+133)
		tmp = Float64(Float64(x + x) * y);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (t + t) * z;
	tmp = 0.0;
	if ((z * t) <= -2e+76)
		tmp = t_1;
	elseif ((z * t) <= 5e+133)
		tmp = (x + x) * y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+76], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e+133], N[(N[(x + x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(t + t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\left(x + x\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -2.0000000000000001e76 or 4.99999999999999961e133 < (*.f64 z t)

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in z around inf

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot t\right) \cdot \color{blue}{z} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot t\right) \cdot \color{blue}{z} \]
      3. count-2-revN/A

        \[\leadsto \left(t + t\right) \cdot z \]
      4. lower-+.f6428.7

        \[\leadsto \left(t + t\right) \cdot z \]
    4. Applied rewrites28.7%

      \[\leadsto \color{blue}{\left(t + t\right) \cdot z} \]

    if -2.0000000000000001e76 < (*.f64 z t) < 4.99999999999999961e133

    1. Initial program 90.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot x\right) \cdot \color{blue}{y} \]
      3. count-2-revN/A

        \[\leadsto \left(x + x\right) \cdot y \]
      4. lower-+.f6429.6

        \[\leadsto \left(x + x\right) \cdot y \]
    4. Applied rewrites29.6%

      \[\leadsto \color{blue}{\left(x + x\right) \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 28.7% accurate, 4.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \left(t + t\right) \cdot z \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i) :precision binary64 (* (+ t t) z))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (t + t) * z;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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)
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
    code = (t + t) * z
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (t + t) * z;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	return (t + t) * z
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(t + t) * z)
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (t + t) * z;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + t), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\left(t + t\right) \cdot z
\end{array}
Derivation
  1. Initial program 90.1%

    \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
  2. Taylor expanded in z around inf

    \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(2 \cdot t\right) \cdot \color{blue}{z} \]
    2. lower-*.f64N/A

      \[\leadsto \left(2 \cdot t\right) \cdot \color{blue}{z} \]
    3. count-2-revN/A

      \[\leadsto \left(t + t\right) \cdot z \]
    4. lower-+.f6428.7

      \[\leadsto \left(t + t\right) \cdot z \]
  4. Applied rewrites28.7%

    \[\leadsto \color{blue}{\left(t + t\right) \cdot z} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025138 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64
  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))