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

Percentage Accurate: 89.6% → 95.3%
Time: 4.4s
Alternatives: 14
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 14 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: 89.6% 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: 95.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \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 \left(y \cdot x - a \cdot \left(i \cdot c\right)\right)\\ \end{array} \end{array} \]
(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 (- (* y x) (* a (* i c)))))))
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 * ((y * x) - (a * (i * c)));
	}
	return tmp;
}
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 * Float64(Float64(y * x) - Float64(a * Float64(i * c))));
	end
	return tmp
end
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[(N[(y * x), $MachinePrecision] - N[(a * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\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 \left(y \cdot x - a \cdot \left(i \cdot c\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 94.9%

      \[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. Add Preprocessing
    3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6498.3

        \[\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) \]
    4. Applied rewrites98.3%

      \[\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 0.0%

      \[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. Add Preprocessing
    3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6418.2

        \[\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) \]
    4. Applied rewrites18.2%

      \[\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) \]
    5. Taylor expanded in x around inf

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

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

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

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

      \[\leadsto 2 \cdot \left(y \cdot x - \color{blue}{a} \cdot \left(i \cdot c\right)\right) \]
    9. Step-by-step derivation
      1. Applied rewrites63.6%

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

    Alternative 2: 85.4% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ t_3 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+182}:\\ \;\;\;\;-2 \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+54}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 10^{+93}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (fma c b a) i) c))
            (t_2 (* (* (+ a (* b c)) c) i))
            (t_3 (* 2.0 (- (* y x) (* (* (fma b c a) c) i)))))
       (if (<= t_2 -1e+182)
         (* -2.0 t_1)
         (if (<= t_2 -2e+54)
           t_3
           (if (<= t_2 1e+93)
             (* 2.0 (fma t z (* y x)))
             (if (<= t_2 2e+298) t_3 (* 2.0 (- (* t z) t_1))))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = (fma(c, b, a) * i) * c;
    	double t_2 = ((a + (b * c)) * c) * i;
    	double t_3 = 2.0 * ((y * x) - ((fma(b, c, a) * c) * i));
    	double tmp;
    	if (t_2 <= -1e+182) {
    		tmp = -2.0 * t_1;
    	} else if (t_2 <= -2e+54) {
    		tmp = t_3;
    	} else if (t_2 <= 1e+93) {
    		tmp = 2.0 * fma(t, z, (y * x));
    	} else if (t_2 <= 2e+298) {
    		tmp = t_3;
    	} else {
    		tmp = 2.0 * ((t * z) - t_1);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = 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(y * x) - Float64(Float64(fma(b, c, a) * c) * i)))
    	tmp = 0.0
    	if (t_2 <= -1e+182)
    		tmp = Float64(-2.0 * t_1);
    	elseif (t_2 <= -2e+54)
    		tmp = t_3;
    	elseif (t_2 <= 1e+93)
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	elseif (t_2 <= 2e+298)
    		tmp = t_3;
    	else
    		tmp = Float64(2.0 * Float64(Float64(t * z) - t_1));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $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[(y * x), $MachinePrecision] - N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+182], N[(-2.0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, -2e+54], t$95$3, If[LessEqual[t$95$2, 1e+93], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+298], t$95$3, N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
    t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
    t_3 := 2 \cdot \left(y \cdot x - \left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right)\\
    \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+182}:\\
    \;\;\;\;-2 \cdot t\_1\\
    
    \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+54}:\\
    \;\;\;\;t\_3\\
    
    \mathbf{elif}\;t\_2 \leq 10^{+93}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
    \;\;\;\;t\_3\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.0000000000000001e182

      1. Initial program 79.4%

        \[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. Add Preprocessing
      3. 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)} \]
      4. 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.f6489.7

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

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

      if -1.0000000000000001e182 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e54 or 1.00000000000000004e93 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e298

      1. Initial program 99.7%

        \[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. Add Preprocessing
      3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6497.6

          \[\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) \]
      4. Applied rewrites97.6%

        \[\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) \]
      5. 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)} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(y \cdot x - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot \color{blue}{i}\right) \]
      7. Applied rewrites85.9%

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

      if -2.0000000000000002e54 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e93

      1. Initial program 99.9%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
        3. lower-*.f6491.5

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

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

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

      1. Initial program 75.5%

        \[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. Add Preprocessing
      3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
        9. lower-fma.f6489.5

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

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

    Alternative 3: 88.8% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+267}:\\ \;\;\;\;-2 \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+280}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (* (+ a (* b c)) c) i)))
       (if (<= t_2 -1e+267)
         (* -2.0 t_1)
         (if (<= t_2 5e+280)
           (* 2.0 (- (fma t z (* y x)) (* (* i c) a)))
           (* 2.0 (- (* t z) t_1))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = (fma(c, b, a) * i) * c;
    	double t_2 = ((a + (b * c)) * c) * i;
    	double tmp;
    	if (t_2 <= -1e+267) {
    		tmp = -2.0 * t_1;
    	} else if (t_2 <= 5e+280) {
    		tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
    	} else {
    		tmp = 2.0 * ((t * z) - t_1);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = 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 <= -1e+267)
    		tmp = Float64(-2.0 * t_1);
    	elseif (t_2 <= 5e+280)
    		tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a)));
    	else
    		tmp = Float64(2.0 * Float64(Float64(t * z) - t_1));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+267], N[(-2.0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e+280], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
    t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
    \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+267}:\\
    \;\;\;\;-2 \cdot t\_1\\
    
    \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+280}:\\
    \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999997e266

      1. Initial program 77.4%

        \[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. Add Preprocessing
      3. 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)} \]
      4. 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.f6490.6

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

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

      if -9.9999999999999997e266 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e280

      1. Initial program 99.9%

        \[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. Add Preprocessing
      3. 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)} \]
      4. 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-*.f6490.6

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

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

      if 5.0000000000000002e280 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 76.9%

        \[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. Add Preprocessing
      3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
        9. lower-fma.f6490.1

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

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

    Alternative 4: 83.5% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+186}:\\ \;\;\;\;-2 \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+15}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (fma c b a) i) c)) (t_2 (* (* (+ a (* b c)) c) i)))
       (if (<= t_2 -1e+186)
         (* -2.0 t_1)
         (if (<= t_2 1e+15) (* 2.0 (fma t z (* y x))) (* 2.0 (- (* t z) t_1))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = (fma(c, b, a) * i) * c;
    	double t_2 = ((a + (b * c)) * c) * i;
    	double tmp;
    	if (t_2 <= -1e+186) {
    		tmp = -2.0 * t_1;
    	} else if (t_2 <= 1e+15) {
    		tmp = 2.0 * fma(t, z, (y * x));
    	} else {
    		tmp = 2.0 * ((t * z) - t_1);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = 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 <= -1e+186)
    		tmp = Float64(-2.0 * t_1);
    	elseif (t_2 <= 1e+15)
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	else
    		tmp = Float64(2.0 * Float64(Float64(t * z) - t_1));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+186], N[(-2.0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+15], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\\
    t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
    \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+186}:\\
    \;\;\;\;-2 \cdot t\_1\\
    
    \mathbf{elif}\;t\_2 \leq 10^{+15}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(t \cdot z - t\_1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999998e185

      1. Initial program 79.0%

        \[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. Add Preprocessing
      3. 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)} \]
      4. 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.f6489.5

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

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

      if -9.9999999999999998e185 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e15

      1. Initial program 99.9%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
        3. lower-*.f6485.6

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      5. Applied rewrites85.6%

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

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

      1. Initial program 83.8%

        \[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. Add Preprocessing
      3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(t \cdot z - \left(\left(c \cdot b + a\right) \cdot i\right) \cdot c\right) \]
        9. lower-fma.f6481.2

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

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

    Alternative 5: 81.7% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \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^{+186} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+242}\right):\\ \;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (+ a (* b c)) c) i)))
       (if (or (<= t_1 -1e+186) (not (<= t_1 2e+242)))
         (* -2.0 (* (* (fma c b a) i) c))
         (* 2.0 (fma t z (* y x))))))
    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+186) || !(t_1 <= 2e+242)) {
    		tmp = -2.0 * ((fma(c, b, a) * i) * c);
    	} else {
    		tmp = 2.0 * fma(t, z, (y * x));
    	}
    	return tmp;
    }
    
    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+186) || !(t_1 <= 2e+242))
    		tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c));
    	else
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	end
    	return tmp
    end
    
    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[Or[LessEqual[t$95$1, -1e+186], N[Not[LessEqual[t$95$1, 2e+242]], $MachinePrecision]], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \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^{+186} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+242}\right):\\
    \;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999998e185 or 2.0000000000000001e242 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 78.5%

        \[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. Add Preprocessing
      3. 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)} \]
      4. 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.f6485.6

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

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

      if -9.9999999999999998e185 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e242

      1. Initial program 99.9%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
        3. lower-*.f6482.4

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      5. Applied rewrites82.4%

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

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

    Alternative 6: 74.3% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \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^{+267}:\\ \;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+242}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (+ a (* b c)) c) i)))
       (if (<= t_1 -1e+267)
         (* (* -2.0 c) (* (* i c) b))
         (if (<= t_1 2e+242)
           (* 2.0 (fma t z (* y x)))
           (* (* c (* c (* i b))) -2.0)))))
    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+267) {
    		tmp = (-2.0 * c) * ((i * c) * b);
    	} else if (t_1 <= 2e+242) {
    		tmp = 2.0 * fma(t, z, (y * x));
    	} else {
    		tmp = (c * (c * (i * b))) * -2.0;
    	}
    	return tmp;
    }
    
    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+267)
    		tmp = Float64(Float64(-2.0 * c) * Float64(Float64(i * c) * b));
    	elseif (t_1 <= 2e+242)
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	else
    		tmp = Float64(Float64(c * Float64(c * Float64(i * b))) * -2.0);
    	end
    	return tmp
    end
    
    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+267], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+242], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(c * N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \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^{+267}:\\
    \;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+242}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(c \cdot \left(c \cdot \left(i \cdot b\right)\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.9999999999999997e266

      1. Initial program 77.4%

        \[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. Add Preprocessing
      3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6486.5

          \[\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) \]
      4. Applied rewrites86.5%

        \[\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) \]
      5. 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)} \]
      6. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

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

          \[\leadsto \left(-2 \cdot c\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) \]
        9. lower-fma.f6490.6

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

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

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

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

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

          \[\leadsto \left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right) \]
        4. lift-*.f6470.0

          \[\leadsto \left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right) \]
      10. Applied rewrites70.0%

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

      if -9.9999999999999997e266 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e242

      1. Initial program 99.9%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
        3. lower-*.f6480.9

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      5. Applied rewrites80.9%

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

      if 2.0000000000000001e242 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 77.8%

        \[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. Add Preprocessing
      3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6490.7

          \[\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) \]
      4. Applied rewrites90.7%

        \[\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) \]
      5. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
      6. 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. pow2N/A

          \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
        7. lift-*.f6453.7

          \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      7. Applied rewrites53.7%

        \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
      8. 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-*.f6455.6

          \[\leadsto \left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2 \]
      9. Applied rewrites55.6%

        \[\leadsto \left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2 \]
      10. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \left(\left(c \cdot c\right) \cdot \left(i \cdot b\right)\right) \cdot -2 \]
        3. lift-*.f64N/A

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

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

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

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

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

          \[\leadsto \left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2 \]
        9. lift-*.f6459.1

          \[\leadsto \left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2 \]
      11. Applied rewrites59.1%

        \[\leadsto \left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot -2 \]
    3. Recombined 3 regimes into one program.
    4. Final simplification74.3%

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

    Alternative 7: 86.8% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + b \cdot c\right) \cdot c\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+150} \lor \neg \left(t\_1 \leq 10^{+280}\right):\\ \;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (+ a (* b c)) c)))
       (if (or (<= t_1 -1e+150) (not (<= t_1 1e+280)))
         (* 2.0 (- (* y x) (* (fma c b a) (* i c))))
         (* 2.0 (- (fma t z (* y x)) (* (* i c) a))))))
    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;
    	double tmp;
    	if ((t_1 <= -1e+150) || !(t_1 <= 1e+280)) {
    		tmp = 2.0 * ((y * x) - (fma(c, b, a) * (i * c)));
    	} else {
    		tmp = 2.0 * (fma(t, z, (y * x)) - ((i * c) * a));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(Float64(a + Float64(b * c)) * c)
    	tmp = 0.0
    	if ((t_1 <= -1e+150) || !(t_1 <= 1e+280))
    		tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(fma(c, b, a) * Float64(i * c))));
    	else
    		tmp = Float64(2.0 * Float64(fma(t, z, Float64(y * x)) - Float64(Float64(i * c) * a)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+150], N[Not[LessEqual[t$95$1, 1e+280]], $MachinePrecision]], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(N[(c * b + a), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(a + b \cdot c\right) \cdot c\\
    \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+150} \lor \neg \left(t\_1 \leq 10^{+280}\right):\\
    \;\;\;\;2 \cdot \left(y \cdot x - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - \left(i \cdot c\right) \cdot a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -9.99999999999999981e149 or 1e280 < (*.f64 (+.f64 a (*.f64 b c)) c)

      1. Initial program 79.0%

        \[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. Add Preprocessing
      3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6491.4

          \[\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) \]
      4. Applied rewrites91.4%

        \[\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) \]
      5. Taylor expanded in x around inf

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

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

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

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

      if -9.99999999999999981e149 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1e280

      1. Initial program 99.2%

        \[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. Add Preprocessing
      3. 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)} \]
      4. 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-*.f6491.8

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

        \[\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. Final simplification91.7%

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

    Alternative 8: 62.6% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \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^{+186} \lor \neg \left(t\_1 \leq 10^{+282}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (+ a (* b c)) c) i)))
       (if (or (<= t_1 -1e+186) (not (<= t_1 1e+282)))
         (* (* (* i c) a) -2.0)
         (* 2.0 (fma t z (* y x))))))
    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+186) || !(t_1 <= 1e+282)) {
    		tmp = ((i * c) * a) * -2.0;
    	} else {
    		tmp = 2.0 * fma(t, z, (y * x));
    	}
    	return tmp;
    }
    
    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+186) || !(t_1 <= 1e+282))
    		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
    	else
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	end
    	return tmp
    end
    
    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[Or[LessEqual[t$95$1, -1e+186], N[Not[LessEqual[t$95$1, 1e+282]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \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^{+186} \lor \neg \left(t\_1 \leq 10^{+282}\right):\\
    \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999998e185 or 1.00000000000000003e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 77.8%

        \[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. Add Preprocessing
      3. Taylor expanded in a around inf

        \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
      4. 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-*.f6443.5

          \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      5. Applied rewrites43.5%

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

      if -9.9999999999999998e185 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000003e282

      1. Initial program 99.9%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
        3. lower-*.f6481.4

          \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right) \]
      5. Applied rewrites81.4%

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

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

    Alternative 9: 71.6% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + b \cdot c\right) \cdot c\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+245} \lor \neg \left(t\_1 \leq 10^{+280}\right):\\ \;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (+ a (* b c)) c)))
       (if (or (<= t_1 -5e+245) (not (<= t_1 1e+280)))
         (* (* -2.0 c) (* (* i c) b))
         (* 2.0 (fma t z (* y x))))))
    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;
    	double tmp;
    	if ((t_1 <= -5e+245) || !(t_1 <= 1e+280)) {
    		tmp = (-2.0 * c) * ((i * c) * b);
    	} else {
    		tmp = 2.0 * fma(t, z, (y * x));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(Float64(a + Float64(b * c)) * c)
    	tmp = 0.0
    	if ((t_1 <= -5e+245) || !(t_1 <= 1e+280))
    		tmp = Float64(Float64(-2.0 * c) * Float64(Float64(i * c) * b));
    	else
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+245], N[Not[LessEqual[t$95$1, 1e+280]], $MachinePrecision]], N[(N[(-2.0 * c), $MachinePrecision] * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(a + b \cdot c\right) \cdot c\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+245} \lor \neg \left(t\_1 \leq 10^{+280}\right):\\
    \;\;\;\;\left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -5.00000000000000034e245 or 1e280 < (*.f64 (+.f64 a (*.f64 b c)) c)

      1. Initial program 75.6%

        \[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. Add Preprocessing
      3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6490.8

          \[\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) \]
      4. Applied rewrites90.8%

        \[\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) \]
      5. 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)} \]
      6. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

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

          \[\leadsto \left(-2 \cdot c\right) \cdot \left(\left(b \cdot c + a\right) \cdot i\right) \]
        9. lower-fma.f6486.6

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

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

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

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

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

          \[\leadsto \left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right) \]
        4. lift-*.f6472.0

          \[\leadsto \left(-2 \cdot c\right) \cdot \left(\left(i \cdot c\right) \cdot b\right) \]
      10. Applied rewrites72.0%

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

      if -5.00000000000000034e245 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1e280

      1. Initial program 98.7%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

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

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

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

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

    Alternative 10: 70.9% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + b \cdot c\right) \cdot c\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+245} \lor \neg \left(t\_1 \leq 10^{+280}\right):\\ \;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (+ a (* b c)) c)))
       (if (or (<= t_1 -5e+245) (not (<= t_1 1e+280)))
         (* (* (* (* c c) i) b) -2.0)
         (* 2.0 (fma t z (* y x))))))
    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;
    	double tmp;
    	if ((t_1 <= -5e+245) || !(t_1 <= 1e+280)) {
    		tmp = (((c * c) * i) * b) * -2.0;
    	} else {
    		tmp = 2.0 * fma(t, z, (y * x));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(Float64(a + Float64(b * c)) * c)
    	tmp = 0.0
    	if ((t_1 <= -5e+245) || !(t_1 <= 1e+280))
    		tmp = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0);
    	else
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+245], N[Not[LessEqual[t$95$1, 1e+280]], $MachinePrecision]], N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(a + b \cdot c\right) \cdot c\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+245} \lor \neg \left(t\_1 \leq 10^{+280}\right):\\
    \;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -5.00000000000000034e245 or 1e280 < (*.f64 (+.f64 a (*.f64 b c)) c)

      1. Initial program 75.6%

        \[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. Add Preprocessing
      3. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-2 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)} \]
      4. 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-*.f6467.8

          \[\leadsto \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2 \]
      5. Applied rewrites67.8%

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

      if -5.00000000000000034e245 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1e280

      1. Initial program 98.7%

        \[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. Add Preprocessing
      3. Taylor expanded in c around 0

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

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

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

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

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

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

    Alternative 11: 43.9% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(t \cdot z\right)\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-22}:\\ \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+51}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* 2.0 (* t z))))
       (if (<= (* z t) -5e+113)
         t_1
         (if (<= (* z t) -1e-22)
           (* (* (* a c) i) -2.0)
           (if (<= (* z t) 2e+51) (* 2.0 (* y x)) t_1)))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = 2.0 * (t * z);
    	double tmp;
    	if ((z * t) <= -5e+113) {
    		tmp = t_1;
    	} else if ((z * t) <= -1e-22) {
    		tmp = ((a * c) * i) * -2.0;
    	} else if ((z * t) <= 2e+51) {
    		tmp = 2.0 * (y * x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b, c, i)
    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 = 2.0d0 * (t * z)
        if ((z * t) <= (-5d+113)) then
            tmp = t_1
        else if ((z * t) <= (-1d-22)) then
            tmp = ((a * c) * i) * (-2.0d0)
        else if ((z * t) <= 2d+51) then
            tmp = 2.0d0 * (y * x)
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = 2.0 * (t * z);
    	double tmp;
    	if ((z * t) <= -5e+113) {
    		tmp = t_1;
    	} else if ((z * t) <= -1e-22) {
    		tmp = ((a * c) * i) * -2.0;
    	} else if ((z * t) <= 2e+51) {
    		tmp = 2.0 * (y * x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b, c, i):
    	t_1 = 2.0 * (t * z)
    	tmp = 0
    	if (z * t) <= -5e+113:
    		tmp = t_1
    	elif (z * t) <= -1e-22:
    		tmp = ((a * c) * i) * -2.0
    	elif (z * t) <= 2e+51:
    		tmp = 2.0 * (y * x)
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(2.0 * Float64(t * z))
    	tmp = 0.0
    	if (Float64(z * t) <= -5e+113)
    		tmp = t_1;
    	elseif (Float64(z * t) <= -1e-22)
    		tmp = Float64(Float64(Float64(a * c) * i) * -2.0);
    	elseif (Float64(z * t) <= 2e+51)
    		tmp = Float64(2.0 * Float64(y * x));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b, c, i)
    	t_1 = 2.0 * (t * z);
    	tmp = 0.0;
    	if ((z * t) <= -5e+113)
    		tmp = t_1;
    	elseif ((z * t) <= -1e-22)
    		tmp = ((a * c) * i) * -2.0;
    	elseif ((z * t) <= 2e+51)
    		tmp = 2.0 * (y * x);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e+113], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -1e-22], N[(N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+51], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := 2 \cdot \left(t \cdot z\right)\\
    \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+113}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-22}:\\
    \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\
    
    \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+51}:\\
    \;\;\;\;2 \cdot \left(y \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 z t) < -5e113 or 2e51 < (*.f64 z t)

      1. Initial program 88.0%

        \[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. Add Preprocessing
      3. Taylor expanded in z around inf

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
      4. Step-by-step derivation
        1. lower-*.f6463.8

          \[\leadsto 2 \cdot \left(t \cdot \color{blue}{z}\right) \]
      5. Applied rewrites63.8%

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]

      if -5e113 < (*.f64 z t) < -1e-22

      1. Initial program 93.3%

        \[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. Add Preprocessing
      3. 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(\color{blue}{\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) - \left(\left(a + \color{blue}{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-*.f6499.7

          \[\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) \]
      4. Applied rewrites99.7%

        \[\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) \]
      5. Taylor expanded in a around inf

        \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
      6. 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. lift-*.f6441.2

          \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      7. Applied rewrites41.2%

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

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

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

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

          \[\leadsto \left(a \cdot \left(c \cdot i\right)\right) \cdot -2 \]
        5. associate-*r*N/A

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

          \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]
        7. lower-*.f6441.3

          \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]
      9. Applied rewrites41.3%

        \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]

      if -1e-22 < (*.f64 z t) < 2e51

      1. Initial program 92.0%

        \[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. Add Preprocessing
      3. Taylor expanded in x around inf

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

          \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
        2. lower-*.f6446.0

          \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
      5. Applied rewrites46.0%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+113}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-22}:\\ \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+51}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 12: 44.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(t \cdot z\right)\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-22}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+51}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* 2.0 (* t z))))
       (if (<= (* z t) -5e+113)
         t_1
         (if (<= (* z t) -1e-22)
           (* (* (* i c) a) -2.0)
           (if (<= (* z t) 2e+51) (* 2.0 (* y x)) t_1)))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = 2.0 * (t * z);
    	double tmp;
    	if ((z * t) <= -5e+113) {
    		tmp = t_1;
    	} else if ((z * t) <= -1e-22) {
    		tmp = ((i * c) * a) * -2.0;
    	} else if ((z * t) <= 2e+51) {
    		tmp = 2.0 * (y * x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b, c, i)
    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 = 2.0d0 * (t * z)
        if ((z * t) <= (-5d+113)) then
            tmp = t_1
        else if ((z * t) <= (-1d-22)) then
            tmp = ((i * c) * a) * (-2.0d0)
        else if ((z * t) <= 2d+51) then
            tmp = 2.0d0 * (y * x)
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = 2.0 * (t * z);
    	double tmp;
    	if ((z * t) <= -5e+113) {
    		tmp = t_1;
    	} else if ((z * t) <= -1e-22) {
    		tmp = ((i * c) * a) * -2.0;
    	} else if ((z * t) <= 2e+51) {
    		tmp = 2.0 * (y * x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b, c, i):
    	t_1 = 2.0 * (t * z)
    	tmp = 0
    	if (z * t) <= -5e+113:
    		tmp = t_1
    	elif (z * t) <= -1e-22:
    		tmp = ((i * c) * a) * -2.0
    	elif (z * t) <= 2e+51:
    		tmp = 2.0 * (y * x)
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(2.0 * Float64(t * z))
    	tmp = 0.0
    	if (Float64(z * t) <= -5e+113)
    		tmp = t_1;
    	elseif (Float64(z * t) <= -1e-22)
    		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
    	elseif (Float64(z * t) <= 2e+51)
    		tmp = Float64(2.0 * Float64(y * x));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b, c, i)
    	t_1 = 2.0 * (t * z);
    	tmp = 0.0;
    	if ((z * t) <= -5e+113)
    		tmp = t_1;
    	elseif ((z * t) <= -1e-22)
    		tmp = ((i * c) * a) * -2.0;
    	elseif ((z * t) <= 2e+51)
    		tmp = 2.0 * (y * x);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e+113], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -1e-22], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+51], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := 2 \cdot \left(t \cdot z\right)\\
    \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+113}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-22}:\\
    \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
    
    \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+51}:\\
    \;\;\;\;2 \cdot \left(y \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 z t) < -5e113 or 2e51 < (*.f64 z t)

      1. Initial program 88.0%

        \[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. Add Preprocessing
      3. Taylor expanded in z around inf

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
      4. Step-by-step derivation
        1. lower-*.f6463.8

          \[\leadsto 2 \cdot \left(t \cdot \color{blue}{z}\right) \]
      5. Applied rewrites63.8%

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]

      if -5e113 < (*.f64 z t) < -1e-22

      1. Initial program 93.3%

        \[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. Add Preprocessing
      3. Taylor expanded in a around inf

        \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
      4. 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-*.f6441.2

          \[\leadsto \left(\left(i \cdot c\right) \cdot a\right) \cdot -2 \]
      5. Applied rewrites41.2%

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

      if -1e-22 < (*.f64 z t) < 2e51

      1. Initial program 92.0%

        \[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. Add Preprocessing
      3. Taylor expanded in x around inf

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

          \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
        2. lower-*.f6446.0

          \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
      5. Applied rewrites46.0%

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

    Alternative 13: 45.1% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+48} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (if (or (<= (* z t) -5e+48) (not (<= (* z t) 2e+51)))
       (* 2.0 (* t z))
       (* 2.0 (* y x))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double tmp;
    	if (((z * t) <= -5e+48) || !((z * t) <= 2e+51)) {
    		tmp = 2.0 * (t * z);
    	} else {
    		tmp = 2.0 * (y * x);
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b, c, i)
    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) :: tmp
        if (((z * t) <= (-5d+48)) .or. (.not. ((z * t) <= 2d+51))) then
            tmp = 2.0d0 * (t * z)
        else
            tmp = 2.0d0 * (y * x)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double tmp;
    	if (((z * t) <= -5e+48) || !((z * t) <= 2e+51)) {
    		tmp = 2.0 * (t * z);
    	} else {
    		tmp = 2.0 * (y * x);
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b, c, i):
    	tmp = 0
    	if ((z * t) <= -5e+48) or not ((z * t) <= 2e+51):
    		tmp = 2.0 * (t * z)
    	else:
    		tmp = 2.0 * (y * x)
    	return tmp
    
    function code(x, y, z, t, a, b, c, i)
    	tmp = 0.0
    	if ((Float64(z * t) <= -5e+48) || !(Float64(z * t) <= 2e+51))
    		tmp = Float64(2.0 * Float64(t * z));
    	else
    		tmp = Float64(2.0 * Float64(y * x));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b, c, i)
    	tmp = 0.0;
    	if (((z * t) <= -5e+48) || ~(((z * t) <= 2e+51)))
    		tmp = 2.0 * (t * z);
    	else
    		tmp = 2.0 * (y * x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e+48], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e+51]], $MachinePrecision]], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+48} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+51}\right):\\
    \;\;\;\;2 \cdot \left(t \cdot z\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(y \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -4.99999999999999973e48 or 2e51 < (*.f64 z t)

      1. Initial program 88.3%

        \[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. Add Preprocessing
      3. Taylor expanded in z around inf

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
      4. Step-by-step derivation
        1. lower-*.f6459.8

          \[\leadsto 2 \cdot \left(t \cdot \color{blue}{z}\right) \]
      5. Applied rewrites59.8%

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]

      if -4.99999999999999973e48 < (*.f64 z t) < 2e51

      1. Initial program 92.3%

        \[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. Add Preprocessing
      3. Taylor expanded in x around inf

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

          \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
        2. lower-*.f6442.7

          \[\leadsto 2 \cdot \left(y \cdot \color{blue}{x}\right) \]
      5. Applied rewrites42.7%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+48} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 14: 29.5% accurate, 3.6× speedup?

    \[\begin{array}{l} \\ 2 \cdot \left(t \cdot z\right) \end{array} \]
    (FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* t z)))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	return 2.0 * (t * z);
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b, c, i)
    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 * (t * z)
    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 * (t * z);
    }
    
    def code(x, y, z, t, a, b, c, i):
    	return 2.0 * (t * z)
    
    function code(x, y, z, t, a, b, c, i)
    	return Float64(2.0 * Float64(t * z))
    end
    
    function tmp = code(x, y, z, t, a, b, c, i)
    	tmp = 2.0 * (t * z);
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    2 \cdot \left(t \cdot z\right)
    \end{array}
    
    Derivation
    1. Initial program 90.8%

      \[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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
    4. Step-by-step derivation
      1. lower-*.f6427.4

        \[\leadsto 2 \cdot \left(t \cdot \color{blue}{z}\right) \]
    5. Applied rewrites27.4%

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
    6. Add Preprocessing

    Developer Target 1: 94.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\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(a + Float64(b * c)) * Float64(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[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
    \end{array}
    

    Reproduce

    ?
    herbie shell --seed 2025084 
    (FPCore (x y z t a b c i)
      :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
      :precision binary64
    
      :alt
      (! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
    
      (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))