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

Percentage Accurate: 89.9% → 93.6%
Time: 10.6s
Alternatives: 14
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));
}
real(8) function code(x, y, z, t, a, b, c, i)
    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 14 alternatives:

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

Initial Program: 89.9% 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));
}
real(8) function code(x, y, z, t, a, b, c, i)
    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: 93.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_1 \leq 10^{+306}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \left(i \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot \left(-c\right)\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 1e+306)
     (* 2.0 (- (+ (* x y) (* z t)) t_1))
     (* 2.0 (fma y x (fma t z (* (* i (fma c b a)) (- 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 <= 1e+306) {
		tmp = 2.0 * (((x * y) + (z * t)) - t_1);
	} else {
		tmp = 2.0 * fma(y, x, fma(t, z, ((i * fma(c, b, a)) * -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 <= 1e+306)
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_1));
	else
		tmp = Float64(2.0 * fma(y, x, fma(t, z, Float64(Float64(i * fma(c, b, a)) * Float64(-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, 1e+306], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[(t * z + N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * (-c)), $MachinePrecision]), $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 10^{+306}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1\right)\\

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


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

    1. Initial program 98.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

    if 1.00000000000000002e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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. 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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.3% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+306}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\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) < -4e3 or 9.99999999999999978e122 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000002e306

    1. Initial program 95.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 0

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(\mathsf{neg}\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right) + x \cdot y\right)} \]
      3. *-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) + x \cdot y\right) \]
      4. 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) + x \cdot y\right) \]
      5. *-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) + x \cdot y\right) \]
      6. 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)} + x \cdot y\right) \]
      7. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e3 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999978e122

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 1.00000000000000002e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 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.f6498.0

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

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

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

Alternative 3: 73.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(\left(c \cdot c\right) \cdot b\right) \cdot -2\right) \cdot i\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 9.9999999999999997e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 87.6%

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

        \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b \cdot {c}^{2}\right) \cdot -2\right) \cdot i \]
    9. Step-by-step derivation
      1. Applied rewrites76.3%

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

      if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999907e214

      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 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-*.f6472.6

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

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

      if -9.99999999999999907e214 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999997e223

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

    Alternative 4: 73.0% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(b \cdot c\right) \cdot c\right) \cdot -2\right) \cdot i\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+215}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{elif}\;t\_2 \leq 10^{+224}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (* (* (* b c) c) -2.0) i)) (t_2 (* (* (+ a (* b c)) c) i)))
       (if (<= t_2 (- INFINITY))
         t_1
         (if (<= t_2 -1e+215)
           (* (* (* i c) a) -2.0)
           (if (<= t_2 1e+224) (* 2.0 (fma t z (* y x))) t_1)))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = (((b * c) * c) * -2.0) * i;
    	double t_2 = ((a + (b * c)) * c) * i;
    	double tmp;
    	if (t_2 <= -((double) INFINITY)) {
    		tmp = t_1;
    	} else if (t_2 <= -1e+215) {
    		tmp = ((i * c) * a) * -2.0;
    	} else if (t_2 <= 1e+224) {
    		tmp = 2.0 * fma(t, z, (y * x));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(Float64(Float64(Float64(b * c) * c) * -2.0) * i)
    	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
    	tmp = 0.0
    	if (t_2 <= Float64(-Inf))
    		tmp = t_1;
    	elseif (t_2 <= -1e+215)
    		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
    	elseif (t_2 <= 1e+224)
    		tmp = Float64(2.0 * fma(t, z, Float64(y * x)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(b * c), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e+215], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$2, 1e+224], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(\left(\left(b \cdot c\right) \cdot c\right) \cdot -2\right) \cdot i\\
    t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
    \mathbf{if}\;t\_2 \leq -\infty:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+215}:\\
    \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
    
    \mathbf{elif}\;t\_2 \leq 10^{+224}:\\
    \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 9.9999999999999997e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 87.6%

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

          \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
        3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b \cdot {c}^{2}\right) \cdot -2\right) \cdot i \]
      9. Step-by-step derivation
        1. Applied rewrites76.3%

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

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

          if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999907e214

          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 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-*.f6472.6

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

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

          if -9.99999999999999907e214 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999997e223

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

          1. Initial program 90.6%

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

              \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
            3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.00000000000000002e100 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999978e122

          1. Initial program 99.9%

            \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
          2. Add Preprocessing
          3. 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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
            3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 91.0%

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

              \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
            3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -4e3 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999978e122

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

          1. Initial program 90.0%

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

              \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
            3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.99999999999999996e109 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e160

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

          1. Initial program 95.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 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. sub-negN/A

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

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

              \[\leadsto 2 \cdot \left(\color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} + t \cdot z\right) \]
            4. 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) \]
            5. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 2 \cdot \left(\color{blue}{\left(\left(\mathsf{neg}\left(b \cdot \left({c}^{2} \cdot i\right)\right)\right) + \left(\mathsf{neg}\left(a \cdot \left(c \cdot i\right)\right)\right)\right)} + t \cdot z\right) \]
          5. Applied rewrites87.6%

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

          if -4e3 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e160

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

          1. Initial program 85.4%

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

              \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
            3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 74.6% accurate, 0.6× speedup?

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

          1. Initial program 88.0%

            \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
          2. Add Preprocessing
          3. 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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
            3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \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-*.f6476.2

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

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

          if -1.9999999999999999e267 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999997e223

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

        Alternative 10: 63.8% accurate, 0.6× speedup?

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

          1. Initial program 89.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-*.f6447.1

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

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

          if -9.99999999999999907e214 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e160

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

        Alternative 11: 42.1% 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^{+106} \lor \neg \left(t\_1 \leq 10^{+123}\right):\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(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 (or (<= t_1 -2e+106) (not (<= t_1 1e+123)))
             (* (* (* i c) a) -2.0)
             (* 2.0 (* 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+106) || !(t_1 <= 1e+123)) {
        		tmp = ((i * c) * a) * -2.0;
        	} else {
        		tmp = 2.0 * (t * z);
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t, a, b, c, i)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8), intent (in) :: c
            real(8), intent (in) :: i
            real(8) :: t_1
            real(8) :: tmp
            t_1 = ((a + (b * c)) * c) * i
            if ((t_1 <= (-2d+106)) .or. (.not. (t_1 <= 1d+123))) then
                tmp = ((i * c) * a) * (-2.0d0)
            else
                tmp = 2.0d0 * (t * z)
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = ((a + (b * c)) * c) * i;
        	double tmp;
        	if ((t_1 <= -2e+106) || !(t_1 <= 1e+123)) {
        		tmp = ((i * c) * a) * -2.0;
        	} else {
        		tmp = 2.0 * (t * z);
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b, c, i):
        	t_1 = ((a + (b * c)) * c) * i
        	tmp = 0
        	if (t_1 <= -2e+106) or not (t_1 <= 1e+123):
        		tmp = ((i * c) * a) * -2.0
        	else:
        		tmp = 2.0 * (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+106) || !(t_1 <= 1e+123))
        		tmp = Float64(Float64(Float64(i * c) * a) * -2.0);
        	else
        		tmp = Float64(2.0 * Float64(t * z));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b, c, i)
        	t_1 = ((a + (b * c)) * c) * i;
        	tmp = 0.0;
        	if ((t_1 <= -2e+106) || ~((t_1 <= 1e+123)))
        		tmp = ((i * c) * a) * -2.0;
        	else
        		tmp = 2.0 * (t * z);
        	end
        	tmp_2 = 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+106], N[Not[LessEqual[t$95$1, 1e+123]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z), $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^{+106} \lor \neg \left(t\_1 \leq 10^{+123}\right):\\
        \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
        
        \mathbf{else}:\\
        \;\;\;\;2 \cdot \left(t \cdot z\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000018e106 or 9.99999999999999978e122 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

          1. Initial program 90.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 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-*.f6444.4

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

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

          if -2.00000000000000018e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999978e122

          1. Initial program 99.9%

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

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

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

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

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

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

        Alternative 12: 94.0% accurate, 1.1× speedup?

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

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

            \[\leadsto 2 \cdot \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(\color{blue}{\left(x \cdot y + z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
          3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 13: 45.0% accurate, 1.2× speedup?

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

          1. Initial program 93.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 inf

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

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

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

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

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

          if -1e114 < (*.f64 x y) < 9.99999999999999983e66

          1. Initial program 95.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 z around inf

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

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

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

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

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

        Alternative 14: 29.8% accurate, 3.6× speedup?

        \[\begin{array}{l} \\ 2 \cdot \left(t \cdot z\right) \end{array} \]
        (FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* t z)))
        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	return 2.0 * (t * z);
        }
        
        real(8) function code(x, y, z, t, a, b, c, i)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8), intent (in) :: c
            real(8), intent (in) :: i
            code = 2.0d0 * (t * z)
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	return 2.0 * (t * z);
        }
        
        def code(x, y, z, t, a, b, c, i):
        	return 2.0 * (t * z)
        
        function code(x, y, z, t, a, b, c, i)
        	return Float64(2.0 * Float64(t * z))
        end
        
        function tmp = code(x, y, z, t, a, b, c, i)
        	tmp = 2.0 * (t * z);
        end
        
        code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        2 \cdot \left(t \cdot z\right)
        \end{array}
        
        Derivation
        1. Initial program 94.9%

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

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

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

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

          \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
        6. Final simplification29.0%

          \[\leadsto 2 \cdot \left(t \cdot z\right) \]
        7. Add Preprocessing

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