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

Percentage Accurate: 90.2% → 95.7%
Time: 13.8s
Alternatives: 15
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
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 15 alternatives:

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

Initial Program: 90.2% 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: 95.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\left(\left(t \cdot z + x \cdot y\right) - t\_2\right) \cdot 2\\

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


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

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \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(z, t, \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(z, t, \color{blue}{\left(i \cdot \left(a + b \cdot c\right)\right) \cdot \left(-1 \cdot c\right)}\right) \]
      3. lower-*.f64N/A

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228

    1. Initial program 97.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. Recombined 2 regimes into one program.
  4. Final simplification96.6%

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

Alternative 2: 85.5% accurate, 0.4× speedup?

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

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

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

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

\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) < -1e138 or 3.2e177 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 80.8%

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

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

        \[\leadsto 2 \cdot \left(\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \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(z, t, \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(z, t, \color{blue}{\left(i \cdot \left(a + b \cdot c\right)\right) \cdot \left(-1 \cdot c\right)}\right) \]
      3. lower-*.f64N/A

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

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

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

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

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

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

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

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

    if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999997e34

    1. Initial program 97.2%

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

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

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

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

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

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

    if 9.9999999999999997e34 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.2e177

    1. Initial program 99.6%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in t 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. 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) + x \cdot y\right) \]
      4. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(\color{blue}{i \cdot \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-*.f6483.7

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

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

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

Alternative 3: 83.7% accurate, 0.4× speedup?

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

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

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

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

\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) < -1e138 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.99999999999999993e73

    1. Initial program 97.3%

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

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

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

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

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

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

    if 3.99999999999999993e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228

    1. Initial program 99.8%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    4. Step-by-step derivation
      1. 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. 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) \]
      4. *-commutativeN/A

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

        \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(\color{blue}{i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)}\right)\right) + t \cdot z\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)} + t \cdot z\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) + t \cdot z\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), t \cdot z\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), t \cdot z\right) \]
      10. lower-neg.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 4: 82.5% accurate, 0.4× speedup?

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

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

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

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

\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) < -1e138 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.99999999999999993e73

    1. Initial program 97.3%

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

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

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

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

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

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

    if 3.99999999999999993e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228

    1. Initial program 99.8%

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

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

        \[\leadsto 2 \cdot \left(\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \color{blue}{\left(\left(-1 \cdot a\right) \cdot c\right)} \cdot i\right) \]
      6. neg-mul-1N/A

        \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \left(\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot c\right) \cdot i\right) \]
      7. lower-neg.f6471.8

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

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

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

Alternative 5: 89.6% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 79.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. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \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(z, t, \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(z, t, \color{blue}{\left(i \cdot \left(a + b \cdot c\right)\right) \cdot \left(-1 \cdot c\right)}\right) \]
      3. lower-*.f64N/A

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

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

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

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

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

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

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

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

    if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228

    1. Initial program 97.7%

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(i \cdot c\right)} \cdot a\right) \]
      4. lower-*.f6492.2

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

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

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

Alternative 6: 93.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 94.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

        \[\leadsto 2 \cdot \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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \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(z, t, \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(z, t, \color{blue}{\left(i \cdot \left(a + b \cdot c\right)\right) \cdot \left(-1 \cdot c\right)}\right) \]
      3. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 7: 82.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

    if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e188

    1. Initial program 97.7%

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

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

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

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

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

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

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

Alternative 8: 74.6% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(i \cdot c\right) \cdot b\right) \cdot c\right) \cdot -2\\


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -2.00000000000000009e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228

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

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

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

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

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

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

        if 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

        1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 74.2% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(\left(c \cdot b\right) \cdot i\right) \cdot c\right) \cdot -2\\ t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+223}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c i)
         :precision binary64
         (let* ((t_1 (* (* (* (* c b) i) c) -2.0)) (t_2 (* i (* (+ (* c b) a) c))))
           (if (<= t_2 -2e+223)
             t_1
             (if (<= t_2 2e+228) (* (fma t z (* x y)) 2.0) t_1))))
        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = (((c * b) * i) * c) * -2.0;
        	double t_2 = i * (((c * b) + a) * c);
        	double tmp;
        	if (t_2 <= -2e+223) {
        		tmp = t_1;
        	} else if (t_2 <= 2e+228) {
        		tmp = fma(t, z, (x * y)) * 2.0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a, b, c, i)
        	t_1 = Float64(Float64(Float64(Float64(c * b) * i) * c) * -2.0)
        	t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
        	tmp = 0.0
        	if (t_2 <= -2e+223)
        		tmp = t_1;
        	elseif (t_2 <= 2e+228)
        		tmp = Float64(fma(t, z, Float64(x * y)) * 2.0);
        	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 * b), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+223], t$95$1, If[LessEqual[t$95$2, 2e+228], N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left(\left(\left(c \cdot b\right) \cdot i\right) \cdot c\right) \cdot -2\\
        t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+223}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
        \;\;\;\;\mathsf{fma}\left(t, z, x \cdot y\right) \cdot 2\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000009e223 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -2.00000000000000009e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228

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

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

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

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

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

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

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

            Alternative 10: 62.7% accurate, 0.6× speedup?

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

              1. Initial program 82.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 t around inf

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

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

                \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
              6. Taylor expanded in a around inf

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

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

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

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

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

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

                  \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot c\right) \cdot i\right) \]
                7. lower-neg.f6448.5

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

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

              if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e188

              1. Initial program 97.7%

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

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

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

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

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

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

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

              1. Initial program 77.4%

                \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
              2. Add Preprocessing
              3. Taylor expanded in 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-*.f6430.4

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

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

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

            Alternative 11: 62.0% accurate, 0.6× speedup?

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

              1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e188

                1. Initial program 97.7%

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

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

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

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

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

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

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

                1. Initial program 77.4%

                  \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
                2. Add Preprocessing
                3. Taylor expanded in 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-*.f6430.4

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

                  \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot a\right) \cdot -2} \]
              8. Recombined 3 regimes into one program.
              9. Final simplification63.9%

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

              Alternative 12: 42.3% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+171}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-53}:\\ \;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-125}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\ \;\;\;\;-2 \cdot \left(\left(i \cdot c\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t a b c i)
               :precision binary64
               (let* ((t_1 (* (* x y) 2.0)))
                 (if (<= (* x y) -2e+171)
                   t_1
                   (if (<= (* x y) -5e-53)
                     (* (* (* i a) c) -2.0)
                     (if (<= (* x y) 5e-125)
                       (* (* t z) 2.0)
                       (if (<= (* x y) 2e+15) (* -2.0 (* (* i c) a)) t_1))))))
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = (x * y) * 2.0;
              	double tmp;
              	if ((x * y) <= -2e+171) {
              		tmp = t_1;
              	} else if ((x * y) <= -5e-53) {
              		tmp = ((i * a) * c) * -2.0;
              	} else if ((x * y) <= 5e-125) {
              		tmp = (t * z) * 2.0;
              	} else if ((x * y) <= 2e+15) {
              		tmp = -2.0 * ((i * c) * a);
              	} else {
              		tmp = t_1;
              	}
              	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 = (x * y) * 2.0d0
                  if ((x * y) <= (-2d+171)) then
                      tmp = t_1
                  else if ((x * y) <= (-5d-53)) then
                      tmp = ((i * a) * c) * (-2.0d0)
                  else if ((x * y) <= 5d-125) then
                      tmp = (t * z) * 2.0d0
                  else if ((x * y) <= 2d+15) then
                      tmp = (-2.0d0) * ((i * c) * a)
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = (x * y) * 2.0;
              	double tmp;
              	if ((x * y) <= -2e+171) {
              		tmp = t_1;
              	} else if ((x * y) <= -5e-53) {
              		tmp = ((i * a) * c) * -2.0;
              	} else if ((x * y) <= 5e-125) {
              		tmp = (t * z) * 2.0;
              	} else if ((x * y) <= 2e+15) {
              		tmp = -2.0 * ((i * c) * a);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t, a, b, c, i):
              	t_1 = (x * y) * 2.0
              	tmp = 0
              	if (x * y) <= -2e+171:
              		tmp = t_1
              	elif (x * y) <= -5e-53:
              		tmp = ((i * a) * c) * -2.0
              	elif (x * y) <= 5e-125:
              		tmp = (t * z) * 2.0
              	elif (x * y) <= 2e+15:
              		tmp = -2.0 * ((i * c) * a)
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t, a, b, c, i)
              	t_1 = Float64(Float64(x * y) * 2.0)
              	tmp = 0.0
              	if (Float64(x * y) <= -2e+171)
              		tmp = t_1;
              	elseif (Float64(x * y) <= -5e-53)
              		tmp = Float64(Float64(Float64(i * a) * c) * -2.0);
              	elseif (Float64(x * y) <= 5e-125)
              		tmp = Float64(Float64(t * z) * 2.0);
              	elseif (Float64(x * y) <= 2e+15)
              		tmp = Float64(-2.0 * Float64(Float64(i * c) * a));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t, a, b, c, i)
              	t_1 = (x * y) * 2.0;
              	tmp = 0.0;
              	if ((x * y) <= -2e+171)
              		tmp = t_1;
              	elseif ((x * y) <= -5e-53)
              		tmp = ((i * a) * c) * -2.0;
              	elseif ((x * y) <= 5e-125)
              		tmp = (t * z) * 2.0;
              	elseif ((x * y) <= 2e+15)
              		tmp = -2.0 * ((i * c) * a);
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+171], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-53], N[(N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-125], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(-2.0 * N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \left(x \cdot y\right) \cdot 2\\
              \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+171}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-53}:\\
              \;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\
              
              \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-125}:\\
              \;\;\;\;\left(t \cdot z\right) \cdot 2\\
              
              \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\
              \;\;\;\;-2 \cdot \left(\left(i \cdot c\right) \cdot a\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if (*.f64 x y) < -1.99999999999999991e171 or 2e15 < (*.f64 x y)

                1. Initial program 88.5%

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

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

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

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

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

                if -1.99999999999999991e171 < (*.f64 x y) < -5e-53

                1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -5e-53 < (*.f64 x y) < 4.99999999999999967e-125

                  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 t around inf

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

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

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

                  if 4.99999999999999967e-125 < (*.f64 x y) < 2e15

                  1. Initial program 83.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 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} \]
                8. Recombined 4 regimes into one program.
                9. Final simplification47.9%

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

                Alternative 13: 43.2% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+171}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-53}:\\ \;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+36}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t a b c i)
                 :precision binary64
                 (let* ((t_1 (* (* x y) 2.0)))
                   (if (<= (* x y) -2e+171)
                     t_1
                     (if (<= (* x y) -5e-53)
                       (* (* (* i a) c) -2.0)
                       (if (<= (* x y) 2e+36) (* (* t z) 2.0) t_1)))))
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double t_1 = (x * y) * 2.0;
                	double tmp;
                	if ((x * y) <= -2e+171) {
                		tmp = t_1;
                	} else if ((x * y) <= -5e-53) {
                		tmp = ((i * a) * c) * -2.0;
                	} else if ((x * y) <= 2e+36) {
                		tmp = (t * z) * 2.0;
                	} else {
                		tmp = t_1;
                	}
                	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 = (x * y) * 2.0d0
                    if ((x * y) <= (-2d+171)) then
                        tmp = t_1
                    else if ((x * y) <= (-5d-53)) then
                        tmp = ((i * a) * c) * (-2.0d0)
                    else if ((x * y) <= 2d+36) then
                        tmp = (t * z) * 2.0d0
                    else
                        tmp = t_1
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double t_1 = (x * y) * 2.0;
                	double tmp;
                	if ((x * y) <= -2e+171) {
                		tmp = t_1;
                	} else if ((x * y) <= -5e-53) {
                		tmp = ((i * a) * c) * -2.0;
                	} else if ((x * y) <= 2e+36) {
                		tmp = (t * z) * 2.0;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a, b, c, i):
                	t_1 = (x * y) * 2.0
                	tmp = 0
                	if (x * y) <= -2e+171:
                		tmp = t_1
                	elif (x * y) <= -5e-53:
                		tmp = ((i * a) * c) * -2.0
                	elif (x * y) <= 2e+36:
                		tmp = (t * z) * 2.0
                	else:
                		tmp = t_1
                	return tmp
                
                function code(x, y, z, t, a, b, c, i)
                	t_1 = Float64(Float64(x * y) * 2.0)
                	tmp = 0.0
                	if (Float64(x * y) <= -2e+171)
                		tmp = t_1;
                	elseif (Float64(x * y) <= -5e-53)
                		tmp = Float64(Float64(Float64(i * a) * c) * -2.0);
                	elseif (Float64(x * y) <= 2e+36)
                		tmp = Float64(Float64(t * z) * 2.0);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a, b, c, i)
                	t_1 = (x * y) * 2.0;
                	tmp = 0.0;
                	if ((x * y) <= -2e+171)
                		tmp = t_1;
                	elseif ((x * y) <= -5e-53)
                		tmp = ((i * a) * c) * -2.0;
                	elseif ((x * y) <= 2e+36)
                		tmp = (t * z) * 2.0;
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+171], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-53], N[(N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+36], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \left(x \cdot y\right) \cdot 2\\
                \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+171}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-53}:\\
                \;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\
                
                \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+36}:\\
                \;\;\;\;\left(t \cdot z\right) \cdot 2\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 x y) < -1.99999999999999991e171 or 2.00000000000000008e36 < (*.f64 x y)

                  1. Initial program 88.6%

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

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

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

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

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

                  if -1.99999999999999991e171 < (*.f64 x y) < -5e-53

                  1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -5e-53 < (*.f64 x y) < 2.00000000000000008e36

                    1. Initial program 87.7%

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

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

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

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

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

                  Alternative 14: 44.6% accurate, 1.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+171}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+36}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b c i)
                   :precision binary64
                   (let* ((t_1 (* (* x y) 2.0)))
                     (if (<= (* x y) -2e+171) t_1 (if (<= (* x y) 2e+36) (* (* t z) 2.0) t_1))))
                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	double t_1 = (x * y) * 2.0;
                  	double tmp;
                  	if ((x * y) <= -2e+171) {
                  		tmp = t_1;
                  	} else if ((x * y) <= 2e+36) {
                  		tmp = (t * z) * 2.0;
                  	} else {
                  		tmp = t_1;
                  	}
                  	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 = (x * y) * 2.0d0
                      if ((x * y) <= (-2d+171)) then
                          tmp = t_1
                      else if ((x * y) <= 2d+36) then
                          tmp = (t * z) * 2.0d0
                      else
                          tmp = t_1
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	double t_1 = (x * y) * 2.0;
                  	double tmp;
                  	if ((x * y) <= -2e+171) {
                  		tmp = t_1;
                  	} else if ((x * y) <= 2e+36) {
                  		tmp = (t * z) * 2.0;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a, b, c, i):
                  	t_1 = (x * y) * 2.0
                  	tmp = 0
                  	if (x * y) <= -2e+171:
                  		tmp = t_1
                  	elif (x * y) <= 2e+36:
                  		tmp = (t * z) * 2.0
                  	else:
                  		tmp = t_1
                  	return tmp
                  
                  function code(x, y, z, t, a, b, c, i)
                  	t_1 = Float64(Float64(x * y) * 2.0)
                  	tmp = 0.0
                  	if (Float64(x * y) <= -2e+171)
                  		tmp = t_1;
                  	elseif (Float64(x * y) <= 2e+36)
                  		tmp = Float64(Float64(t * z) * 2.0);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a, b, c, i)
                  	t_1 = (x * y) * 2.0;
                  	tmp = 0.0;
                  	if ((x * y) <= -2e+171)
                  		tmp = t_1;
                  	elseif ((x * y) <= 2e+36)
                  		tmp = (t * z) * 2.0;
                  	else
                  		tmp = t_1;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+171], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+36], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \left(x \cdot y\right) \cdot 2\\
                  \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+171}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+36}:\\
                  \;\;\;\;\left(t \cdot z\right) \cdot 2\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 x y) < -1.99999999999999991e171 or 2.00000000000000008e36 < (*.f64 x y)

                    1. Initial program 88.6%

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

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

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

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

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

                    if -1.99999999999999991e171 < (*.f64 x y) < 2.00000000000000008e36

                    1. Initial program 89.7%

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

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

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

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

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

                  Alternative 15: 30.1% accurate, 3.6× speedup?

                  \[\begin{array}{l} \\ \left(t \cdot z\right) \cdot 2 \end{array} \]
                  (FPCore (x y z t a b c i) :precision binary64 (* (* t z) 2.0))
                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	return (t * z) * 2.0;
                  }
                  
                  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 = (t * z) * 2.0d0
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	return (t * z) * 2.0;
                  }
                  
                  def code(x, y, z, t, a, b, c, i):
                  	return (t * z) * 2.0
                  
                  function code(x, y, z, t, a, b, c, i)
                  	return Float64(Float64(t * z) * 2.0)
                  end
                  
                  function tmp = code(x, y, z, t, a, b, c, i)
                  	tmp = (t * z) * 2.0;
                  end
                  
                  code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \left(t \cdot z\right) \cdot 2
                  \end{array}
                  
                  Derivation
                  1. Initial program 89.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 t around inf

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

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

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

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

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

                  \[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \end{array} \]
                  (FPCore (x y z t a b c i)
                   :precision binary64
                   (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
                  }
                  
                  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 2024276 
                  (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))))