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

Percentage Accurate: 90.3% → 95.3%
Time: 8.6s
Alternatives: 13
Speedup: 1.1×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 90.3% 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, 1.1× speedup?

\[\begin{array}{l} \\ 2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-i\right) \cdot c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (fma (fma c b a) (* (- i) c) (fma t z (* y x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * fma(fma(c, b, a), (-i * c), fma(t, z, (y * x)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * fma(fma(c, b, a), Float64(Float64(-i) * c), fma(t, z, Float64(y * x))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * N[((-i) * c), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-i\right) \cdot c, \mathsf{fma}\left(t, z, y \cdot x\right)\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. Step-by-step derivation
    1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.9% accurate, 0.4× 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 -\infty:\\ \;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(i \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+46}\right):\\ \;\;\;\;2 \cdot \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (- INFINITY))
     (* (* -2.0 (fma b c a)) (* i c))
     (if (or (<= t_1 -2e+53) (not (<= t_1 2e+46)))
       (* 2.0 (fma (- i) (* (fma c b a) c) (* t z)))
       (* (fma t z (* y x)) 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 <= -((double) INFINITY)) {
		tmp = (-2.0 * fma(b, c, a)) * (i * c);
	} else if ((t_1 <= -2e+53) || !(t_1 <= 2e+46)) {
		tmp = 2.0 * fma(-i, (fma(c, b, a) * c), (t * z));
	} else {
		tmp = fma(t, z, (y * x)) * 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 <= Float64(-Inf))
		tmp = Float64(Float64(-2.0 * fma(b, c, a)) * Float64(i * c));
	elseif ((t_1 <= -2e+53) || !(t_1 <= 2e+46))
		tmp = Float64(2.0 * fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)));
	else
		tmp = Float64(fma(t, z, Float64(y * x)) * 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, (-Infinity)], N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -2e+53], N[Not[LessEqual[t$95$1, 2e+46]], $MachinePrecision]], N[(2.0 * N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * z + N[(y * x), $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 -\infty:\\
\;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(i \cdot c\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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) < -inf.0

    1. Initial program 68.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 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. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
      9. distribute-rgt-inN/A

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

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

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

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

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

        \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
      15. lower-fma.f6489.8

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

      \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
    6. Step-by-step derivation
      1. Applied rewrites89.9%

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

      if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e53 or 2e46 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(-i, \color{blue}{\mathsf{fma}\left(c, b, a\right)} \cdot c, t \cdot z\right) \]
        17. lower-*.f6487.8

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

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

      if -2e53 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e46

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

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

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

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

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

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

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

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

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

    Alternative 3: 87.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(-i, \color{blue}{\mathsf{fma}\left(c, b, a\right)} \cdot c, t \cdot z\right) \]
        17. lower-*.f6482.3

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

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right)} \]
      6. 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)} \]
      7. Step-by-step derivation
        1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.99999999999999972e57 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000007e286

      1. Initial program 99.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 \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
        2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 85.7% accurate, 0.5× 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 -2 \cdot 10^{+53}:\\ \;\;\;\;\mathsf{fma}\left(\left(-i\right) \cdot c, \mathsf{fma}\left(c, b, a\right), y \cdot x\right) \cdot 2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+46}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\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 (<= t_1 -2e+53)
         (* (fma (* (- i) c) (fma c b a) (* y x)) 2.0)
         (if (<= t_1 2e+46)
           (* (fma t z (* y x)) 2.0)
           (* 2.0 (fma (- i) (* (fma c b a) c) (* t z)))))))
    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 <= -2e+53) {
    		tmp = fma((-i * c), fma(c, b, a), (y * x)) * 2.0;
    	} else if (t_1 <= 2e+46) {
    		tmp = fma(t, z, (y * x)) * 2.0;
    	} else {
    		tmp = 2.0 * fma(-i, (fma(c, b, a) * c), (t * z));
    	}
    	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 <= -2e+53)
    		tmp = Float64(fma(Float64(Float64(-i) * c), fma(c, b, a), Float64(y * x)) * 2.0);
    	elseif (t_1 <= 2e+46)
    		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
    	else
    		tmp = Float64(2.0 * fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)));
    	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, -2e+53], N[(N[(N[((-i) * c), $MachinePrecision] * N[(c * b + a), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+46], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $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 -2 \cdot 10^{+53}:\\
    \;\;\;\;\mathsf{fma}\left(\left(-i\right) \cdot c, \mathsf{fma}\left(c, b, a\right), y \cdot x\right) \cdot 2\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+46}:\\
    \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e53

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(-i, \color{blue}{\mathsf{fma}\left(c, b, a\right)} \cdot c, t \cdot z\right) \]
        17. lower-*.f6479.4

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

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right)} \]
      6. 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)} \]
      7. Step-by-step derivation
        1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2e53 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e46

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

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

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

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

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

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

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

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

      if 2e46 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 86.1%

        \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \mathsf{fma}\left(-i, \color{blue}{\mathsf{fma}\left(c, b, a\right)} \cdot c, t \cdot z\right) \]
        17. lower-*.f6486.2

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

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

    Alternative 5: 82.2% 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 -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+222}\right):\\ \;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(i \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -2e+53) (not (<= t_1 5e+222)))
         (* (* -2.0 (fma b c a)) (* i c))
         (* (fma t z (* y x)) 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 <= -2e+53) || !(t_1 <= 5e+222)) {
    		tmp = (-2.0 * fma(b, c, a)) * (i * c);
    	} else {
    		tmp = fma(t, z, (y * x)) * 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 <= -2e+53) || !(t_1 <= 5e+222))
    		tmp = Float64(Float64(-2.0 * fma(b, c, a)) * Float64(i * c));
    	else
    		tmp = Float64(fma(t, z, Float64(y * x)) * 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[Or[LessEqual[t$95$1, -2e+53], N[Not[LessEqual[t$95$1, 5e+222]], $MachinePrecision]], N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision], N[(N[(t * z + N[(y * x), $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 -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+222}\right):\\
    \;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(i \cdot c\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e53 or 5.00000000000000023e222 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 81.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 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. *-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
        9. distribute-rgt-inN/A

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

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

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

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

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

          \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
        15. lower-fma.f6481.1

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

        \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
      6. Step-by-step derivation
        1. Applied rewrites85.0%

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

        if -2e53 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000023e222

        1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

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

      Alternative 6: 80.9% 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 -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+222}\right):\\ \;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -2e+53) (not (<= t_1 5e+222)))
           (* (* -2.0 (* (fma c b a) i)) c)
           (* (fma t z (* y x)) 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 <= -2e+53) || !(t_1 <= 5e+222)) {
      		tmp = (-2.0 * (fma(c, b, a) * i)) * c;
      	} else {
      		tmp = fma(t, z, (y * x)) * 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 <= -2e+53) || !(t_1 <= 5e+222))
      		tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c);
      	else
      		tmp = Float64(fma(t, z, Float64(y * x)) * 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[Or[LessEqual[t$95$1, -2e+53], N[Not[LessEqual[t$95$1, 5e+222]], $MachinePrecision]], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(t * z + N[(y * x), $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 -2 \cdot 10^{+53} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+222}\right):\\
      \;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e53 or 5.00000000000000023e222 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

        1. Initial program 81.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 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. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
          9. distribute-rgt-inN/A

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

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

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

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

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

            \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
          15. lower-fma.f6481.1

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

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

        if -2e53 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000023e222

        1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

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

      Alternative 7: 74.2% 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 -5 \cdot 10^{+195} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+222}\right):\\ \;\;\;\;\left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -5e+195) (not (<= t_1 5e+222)))
           (* (* -2.0 (* (* i c) b)) c)
           (* (fma t z (* y x)) 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 <= -5e+195) || !(t_1 <= 5e+222)) {
      		tmp = (-2.0 * ((i * c) * b)) * c;
      	} else {
      		tmp = fma(t, z, (y * x)) * 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 <= -5e+195) || !(t_1 <= 5e+222))
      		tmp = Float64(Float64(-2.0 * Float64(Float64(i * c) * b)) * c);
      	else
      		tmp = Float64(fma(t, z, Float64(y * x)) * 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[Or[LessEqual[t$95$1, -5e+195], N[Not[LessEqual[t$95$1, 5e+222]], $MachinePrecision]], N[(N[(-2.0 * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(t * z + N[(y * x), $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 -5 \cdot 10^{+195} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+222}\right):\\
      \;\;\;\;\left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e195 or 5.00000000000000023e222 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

        1. Initial program 78.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. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
          9. distribute-rgt-inN/A

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

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

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

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

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

            \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
          15. lower-fma.f6485.6

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

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

          \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
        7. Step-by-step derivation
          1. Applied rewrites62.8%

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

          if -4.9999999999999998e195 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000023e222

          1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

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

        Alternative 8: 74.0% 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 -5 \cdot 10^{+195}:\\ \;\;\;\;\left(\left(b \cdot c\right) \cdot \left(i \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+222}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c\\ \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 -5e+195)
             (* (* (* b c) (* i c)) -2.0)
             (if (<= t_1 5e+222)
               (* (fma t z (* y x)) 2.0)
               (* (* -2.0 (* (* i c) b)) c)))))
        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 <= -5e+195) {
        		tmp = ((b * c) * (i * c)) * -2.0;
        	} else if (t_1 <= 5e+222) {
        		tmp = fma(t, z, (y * x)) * 2.0;
        	} else {
        		tmp = (-2.0 * ((i * c) * b)) * c;
        	}
        	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 <= -5e+195)
        		tmp = Float64(Float64(Float64(b * c) * Float64(i * c)) * -2.0);
        	elseif (t_1 <= 5e+222)
        		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
        	else
        		tmp = Float64(Float64(-2.0 * Float64(Float64(i * c) * b)) * c);
        	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, -5e+195], N[(N[(N[(b * c), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+222], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(-2.0 * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * c), $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 -5 \cdot 10^{+195}:\\
        \;\;\;\;\left(\left(b \cdot c\right) \cdot \left(i \cdot c\right)\right) \cdot -2\\
        
        \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+222}:\\
        \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e195

          1. Initial program 74.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 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 \color{blue}{\left(b \cdot \left({c}^{2} \cdot i\right)\right) \cdot -2} \]
            2. lower-*.f64N/A

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

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

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

              \[\leadsto \left(\color{blue}{\left({c}^{2} \cdot i\right)} \cdot b\right) \cdot -2 \]
            6. unpow2N/A

              \[\leadsto \left(\left(\color{blue}{\left(c \cdot c\right)} \cdot i\right) \cdot b\right) \cdot -2 \]
            7. lower-*.f6451.4

              \[\leadsto \left(\left(\color{blue}{\left(c \cdot c\right)} \cdot i\right) \cdot b\right) \cdot -2 \]
          5. Applied rewrites51.4%

            \[\leadsto \color{blue}{\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2} \]
          6. Step-by-step derivation
            1. Applied rewrites60.3%

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

            if -4.9999999999999998e195 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000023e222

            1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

            if 5.00000000000000023e222 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

            1. Initial program 81.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 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. *-commutativeN/A

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

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

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

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

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

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

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

                \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
              9. distribute-rgt-inN/A

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

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

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

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

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

                \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
              15. lower-fma.f6485.2

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

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

              \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
            7. Step-by-step derivation
              1. Applied rewrites66.9%

                \[\leadsto \left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 9: 73.9% 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 -5 \cdot 10^{+195}:\\ \;\;\;\;\left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+222}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c\\ \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 -5e+195)
                 (* (* -2.0 (* (* b c) i)) c)
                 (if (<= t_1 5e+222)
                   (* (fma t z (* y x)) 2.0)
                   (* (* -2.0 (* (* i c) b)) c)))))
            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 <= -5e+195) {
            		tmp = (-2.0 * ((b * c) * i)) * c;
            	} else if (t_1 <= 5e+222) {
            		tmp = fma(t, z, (y * x)) * 2.0;
            	} else {
            		tmp = (-2.0 * ((i * c) * b)) * c;
            	}
            	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 <= -5e+195)
            		tmp = Float64(Float64(-2.0 * Float64(Float64(b * c) * i)) * c);
            	elseif (t_1 <= 5e+222)
            		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
            	else
            		tmp = Float64(Float64(-2.0 * Float64(Float64(i * c) * b)) * c);
            	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, -5e+195], N[(N[(-2.0 * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 5e+222], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(-2.0 * N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * c), $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 -5 \cdot 10^{+195}:\\
            \;\;\;\;\left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right) \cdot c\\
            
            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+222}:\\
            \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e195

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                9. distribute-rgt-inN/A

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

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

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

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

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

                  \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                15. lower-fma.f6486.1

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

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

                \[\leadsto \left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
              7. Step-by-step derivation
                1. Applied rewrites59.6%

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

                if -4.9999999999999998e195 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000023e222

                1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

                if 5.00000000000000023e222 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                1. Initial program 81.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 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. *-commutativeN/A

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

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

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

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

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

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

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

                    \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                  9. distribute-rgt-inN/A

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

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

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

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

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

                    \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                  15. lower-fma.f6485.2

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

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

                  \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
                7. Step-by-step derivation
                  1. Applied rewrites66.9%

                    \[\leadsto \left(-2 \cdot \left(\left(i \cdot c\right) \cdot b\right)\right) \cdot c \]
                8. Recombined 3 regimes into one program.
                9. Add Preprocessing

                Alternative 10: 62.5% 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 -2 \cdot 10^{+190}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+286}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(-i\right) \cdot \left(c \cdot a\right)\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 (<= t_1 -2e+190)
                     (* (* (* i c) a) -2.0)
                     (if (<= t_1 2e+286)
                       (* (fma t z (* y x)) 2.0)
                       (* 2.0 (* (- 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) * i;
                	double tmp;
                	if (t_1 <= -2e+190) {
                		tmp = ((i * c) * a) * -2.0;
                	} else if (t_1 <= 2e+286) {
                		tmp = fma(t, z, (y * x)) * 2.0;
                	} else {
                		tmp = 2.0 * (-i * (c * a));
                	}
                	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 <= -2e+190)
                		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
                	elseif (t_1 <= 2e+286)
                		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
                	else
                		tmp = Float64(2.0 * Float64(Float64(-i) * Float64(c * a)));
                	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, -2e+190], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+286], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[((-i) * N[(c * a), $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 -2 \cdot 10^{+190}:\\
                \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                
                \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+286}:\\
                \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                
                \mathbf{else}:\\
                \;\;\;\;2 \cdot \left(\left(-i\right) \cdot \left(c \cdot a\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000001e190

                  1. Initial program 75.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 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 \color{blue}{\left(a \cdot \left(c \cdot i\right)\right) \cdot -2} \]
                    2. lower-*.f64N/A

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

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

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

                      \[\leadsto \left(\color{blue}{\left(i \cdot c\right)} \cdot a\right) \cdot -2 \]
                    6. lower-*.f6441.9

                      \[\leadsto \left(\color{blue}{\left(i \cdot c\right)} \cdot a\right) \cdot -2 \]
                  5. Applied rewrites41.9%

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

                  if -2.0000000000000001e190 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000007e286

                  1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

                  if 2.00000000000000007e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                  1. Initial program 80.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 a around inf

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

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

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

                      \[\leadsto 2 \cdot \left(\color{blue}{\left(\left(-1 \cdot c\right) \cdot i\right)} \cdot a\right) \]
                    4. associate-*l*N/A

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

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

                      \[\leadsto 2 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(c\right)\right)} \cdot \left(a \cdot i\right)\right) \]
                    7. distribute-lft-neg-inN/A

                      \[\leadsto 2 \cdot \color{blue}{\left(\mathsf{neg}\left(c \cdot \left(a \cdot i\right)\right)\right)} \]
                    8. associate-*r*N/A

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

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

                      \[\leadsto 2 \cdot \left(\mathsf{neg}\left(\color{blue}{i \cdot \left(a \cdot c\right)}\right)\right) \]
                    11. distribute-lft-neg-inN/A

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

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

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

                      \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \color{blue}{\left(c \cdot a\right)}\right) \]
                    15. lower-*.f6448.9

                      \[\leadsto 2 \cdot \left(\left(-i\right) \cdot \color{blue}{\left(c \cdot a\right)}\right) \]
                  5. Applied rewrites48.9%

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

                Alternative 11: 63.2% 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 -2 \cdot 10^{+190} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+286}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (or (<= t_1 -2e+190) (not (<= t_1 2e+286)))
                     (* (* (* i c) a) -2.0)
                     (* (fma t z (* y x)) 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 <= -2e+190) || !(t_1 <= 2e+286)) {
                		tmp = ((i * c) * a) * -2.0;
                	} else {
                		tmp = fma(t, z, (y * x)) * 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 <= -2e+190) || !(t_1 <= 2e+286))
                		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
                	else
                		tmp = Float64(fma(t, z, Float64(y * x)) * 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[Or[LessEqual[t$95$1, -2e+190], N[Not[LessEqual[t$95$1, 2e+286]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(t * z + N[(y * x), $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 -2 \cdot 10^{+190} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+286}\right):\\
                \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000001e190 or 2.00000000000000007e286 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                  1. Initial program 78.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 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 \color{blue}{\left(a \cdot \left(c \cdot i\right)\right) \cdot -2} \]
                    2. lower-*.f64N/A

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

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

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

                      \[\leadsto \left(\color{blue}{\left(i \cdot c\right)} \cdot a\right) \cdot -2 \]
                    6. lower-*.f6442.6

                      \[\leadsto \left(\color{blue}{\left(i \cdot c\right)} \cdot a\right) \cdot -2 \]
                  5. Applied rewrites42.6%

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

                  if -2.0000000000000001e190 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000007e286

                  1. Initial program 99.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 c around 0

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

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

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

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

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

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

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

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

                Alternative 12: 44.0% accurate, 1.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+52} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+136}\right):\\ \;\;\;\;\left(y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 2\\ \end{array} \end{array} \]
                (FPCore (x y z t a b c i)
                 :precision binary64
                 (if (or (<= (* x y) -2e+52) (not (<= (* x y) 5e+136)))
                   (* (* y x) 2.0)
                   (* (* t z) 2.0)))
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double tmp;
                	if (((x * y) <= -2e+52) || !((x * y) <= 5e+136)) {
                		tmp = (y * x) * 2.0;
                	} else {
                		tmp = (t * z) * 2.0;
                	}
                	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 (((x * y) <= (-2d+52)) .or. (.not. ((x * y) <= 5d+136))) then
                        tmp = (y * x) * 2.0d0
                    else
                        tmp = (t * z) * 2.0d0
                    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 (((x * y) <= -2e+52) || !((x * y) <= 5e+136)) {
                		tmp = (y * x) * 2.0;
                	} else {
                		tmp = (t * z) * 2.0;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a, b, c, i):
                	tmp = 0
                	if ((x * y) <= -2e+52) or not ((x * y) <= 5e+136):
                		tmp = (y * x) * 2.0
                	else:
                		tmp = (t * z) * 2.0
                	return tmp
                
                function code(x, y, z, t, a, b, c, i)
                	tmp = 0.0
                	if ((Float64(x * y) <= -2e+52) || !(Float64(x * y) <= 5e+136))
                		tmp = Float64(Float64(y * x) * 2.0);
                	else
                		tmp = Float64(Float64(t * z) * 2.0);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a, b, c, i)
                	tmp = 0.0;
                	if (((x * y) <= -2e+52) || ~(((x * y) <= 5e+136)))
                		tmp = (y * x) * 2.0;
                	else
                		tmp = (t * z) * 2.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+52], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+136]], $MachinePrecision]], N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+52} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+136}\right):\\
                \;\;\;\;\left(y \cdot x\right) \cdot 2\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(t \cdot z\right) \cdot 2\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 x y) < -2e52 or 5.0000000000000002e136 < (*.f64 x y)

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

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

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

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

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

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

                  if -2e52 < (*.f64 x y) < 5.0000000000000002e136

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

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

                      \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 2} \]
                    3. lower-*.f6441.7

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

                    \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 2} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification47.8%

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

                Alternative 13: 28.8% accurate, 3.6× speedup?

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

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

                    \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 2} \]
                  3. lower-*.f6431.5

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

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

                Developer Target 1: 94.3% 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 2024354 
                (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))))