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

Percentage Accurate: 90.4% → 93.3%
Time: 16.0s
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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 93.3% accurate, 0.5× speedup?

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

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

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


\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 95.3%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites96.8%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites33.3%

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \color{blue}{-1 \cdot \left(b \cdot \left({c}^{2} \cdot i\right)\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, \mathsf{neg}\left(\color{blue}{\left({c}^{2} \cdot i\right) \cdot b}\right)\right) \]
      4. unpow2N/A

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

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

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

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

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

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

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

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

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

Alternative 2: 68.1% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000002e141 < (*.f64 (+.f64 a (*.f64 b c)) c) < -1e47

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(c \cdot \color{blue}{\left(\mathsf{neg}\left(i\right)\right)}\right)\right) \]
      10. lower-neg.f6479.4

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot -1\right) \cdot \left(i \cdot c\right)\right)} \cdot a \]
      13. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

    if -1e47 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000007e170

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

    1. Initial program 82.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 68.7% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000002e141 or 2.00000000000000007e170 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 82.7%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites92.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000002e141 < (*.f64 (+.f64 a (*.f64 b c)) c) < -1e47

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(c \cdot \color{blue}{\left(\mathsf{neg}\left(i\right)\right)}\right)\right) \]
      10. lower-neg.f6479.4

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot -1\right) \cdot \left(i \cdot c\right)\right)} \cdot a \]
      13. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

    if -1e47 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000007e170

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

Alternative 4: 87.6% accurate, 0.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999994e59 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000005e54

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000005e54 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.2% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 83.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 x around 0

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999994e59 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e272

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.8% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999945e-21 or 1.99999999999999995e38 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 86.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 x around 0

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999945e-21 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999995e38

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

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

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

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

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

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

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

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

Alternative 7: 87.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 81.3%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e206 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999997e59

    1. Initial program 98.4%

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a \cdot c\right)} \cdot i\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 a\right)} \cdot i\right) \]
      2. lower-*.f6493.7

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

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

    if 4.9999999999999997e59 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.3% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 83.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 i around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999994e59 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e272

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

Alternative 9: 84.3% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 81.3%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e206 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999997e59

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e59 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 41.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(-2 \cdot \left(c \cdot i\right)\right)\\ t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+107}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* a (* -2.0 (* c i)))) (t_2 (* (* c (+ a (* b c))) i)))
   (if (<= t_2 -1e-20) t_1 (if (<= t_2 5e+107) (* y (* x 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 = a * (-2.0 * (c * i));
	double t_2 = (c * (a + (b * c))) * i;
	double tmp;
	if (t_2 <= -1e-20) {
		tmp = t_1;
	} else if (t_2 <= 5e+107) {
		tmp = y * (x * 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) :: t_2
    real(8) :: tmp
    t_1 = a * ((-2.0d0) * (c * i))
    t_2 = (c * (a + (b * c))) * i
    if (t_2 <= (-1d-20)) then
        tmp = t_1
    else if (t_2 <= 5d+107) then
        tmp = y * (x * 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 = a * (-2.0 * (c * i));
	double t_2 = (c * (a + (b * c))) * i;
	double tmp;
	if (t_2 <= -1e-20) {
		tmp = t_1;
	} else if (t_2 <= 5e+107) {
		tmp = y * (x * 2.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a * (-2.0 * (c * i))
	t_2 = (c * (a + (b * c))) * i
	tmp = 0
	if t_2 <= -1e-20:
		tmp = t_1
	elif t_2 <= 5e+107:
		tmp = y * (x * 2.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a * Float64(-2.0 * Float64(c * i)))
	t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i)
	tmp = 0.0
	if (t_2 <= -1e-20)
		tmp = t_1;
	elseif (t_2 <= 5e+107)
		tmp = Float64(y * Float64(x * 2.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a * (-2.0 * (c * i));
	t_2 = (c * (a + (b * c))) * i;
	tmp = 0.0;
	if (t_2 <= -1e-20)
		tmp = t_1;
	elseif (t_2 <= 5e+107)
		tmp = y * (x * 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[(a * N[(-2.0 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-20], t$95$1, If[LessEqual[t$95$2, 5e+107], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999945e-21 or 5.0000000000000002e107 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 85.6%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot -1\right) \cdot \left(i \cdot c\right)\right)} \cdot a \]
      13. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999945e-21 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e107

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 42.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(x \cdot 2\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{-233}:\\ \;\;\;\;t \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\ \;\;\;\;i \cdot \left(a \cdot \left(c \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* y (* x 2.0))))
   (if (<= (* x y) -2e+57)
     t_1
     (if (<= (* x y) 1e-233)
       (* t (* z 2.0))
       (if (<= (* x y) 5e+77) (* i (* a (* c -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 = y * (x * 2.0);
	double tmp;
	if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= 1e-233) {
		tmp = t * (z * 2.0);
	} else if ((x * y) <= 5e+77) {
		tmp = i * (a * (c * -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 = y * (x * 2.0d0)
    if ((x * y) <= (-2d+57)) then
        tmp = t_1
    else if ((x * y) <= 1d-233) then
        tmp = t * (z * 2.0d0)
    else if ((x * y) <= 5d+77) then
        tmp = i * (a * (c * (-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 = y * (x * 2.0);
	double tmp;
	if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= 1e-233) {
		tmp = t * (z * 2.0);
	} else if ((x * y) <= 5e+77) {
		tmp = i * (a * (c * -2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = y * (x * 2.0)
	tmp = 0
	if (x * y) <= -2e+57:
		tmp = t_1
	elif (x * y) <= 1e-233:
		tmp = t * (z * 2.0)
	elif (x * y) <= 5e+77:
		tmp = i * (a * (c * -2.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(y * Float64(x * 2.0))
	tmp = 0.0
	if (Float64(x * y) <= -2e+57)
		tmp = t_1;
	elseif (Float64(x * y) <= 1e-233)
		tmp = Float64(t * Float64(z * 2.0));
	elseif (Float64(x * y) <= 5e+77)
		tmp = Float64(i * Float64(a * Float64(c * -2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = y * (x * 2.0);
	tmp = 0.0;
	if ((x * y) <= -2e+57)
		tmp = t_1;
	elseif ((x * y) <= 1e-233)
		tmp = t * (z * 2.0);
	elseif ((x * y) <= 5e+77)
		tmp = i * (a * (c * -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[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-233], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+77], N[(i * N[(a * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\
\;\;\;\;i \cdot \left(a \cdot \left(c \cdot -2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.0000000000000001e57 or 5.00000000000000004e77 < (*.f64 x y)

    1. Initial program 91.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 x around inf

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e57 < (*.f64 x y) < 9.99999999999999958e-234

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

    if 9.99999999999999958e-234 < (*.f64 x y) < 5.00000000000000004e77

    1. Initial program 93.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(c \cdot \color{blue}{\left(\mathsf{neg}\left(i\right)\right)}\right)\right) \]
      10. lower-neg.f6437.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(\left(2 \cdot -1\right) \cdot c\right)} \cdot a\right) \cdot i \]
      19. metadata-evalN/A

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

        \[\leadsto \left(\color{blue}{\left(c \cdot -2\right)} \cdot a\right) \cdot i \]
      21. lift-*.f6437.2

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

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

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

Alternative 12: 42.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(x \cdot 2\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-137}:\\ \;\;\;\;t \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\ \;\;\;\;c \cdot \left(a \cdot \left(i \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* y (* x 2.0))))
   (if (<= (* x y) -2e+57)
     t_1
     (if (<= (* x y) 5e-137)
       (* t (* z 2.0))
       (if (<= (* x y) 5e+77) (* c (* a (* 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 = y * (x * 2.0);
	double tmp;
	if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= 5e-137) {
		tmp = t * (z * 2.0);
	} else if ((x * y) <= 5e+77) {
		tmp = c * (a * (i * -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 = y * (x * 2.0d0)
    if ((x * y) <= (-2d+57)) then
        tmp = t_1
    else if ((x * y) <= 5d-137) then
        tmp = t * (z * 2.0d0)
    else if ((x * y) <= 5d+77) then
        tmp = c * (a * (i * (-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 = y * (x * 2.0);
	double tmp;
	if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= 5e-137) {
		tmp = t * (z * 2.0);
	} else if ((x * y) <= 5e+77) {
		tmp = c * (a * (i * -2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = y * (x * 2.0)
	tmp = 0
	if (x * y) <= -2e+57:
		tmp = t_1
	elif (x * y) <= 5e-137:
		tmp = t * (z * 2.0)
	elif (x * y) <= 5e+77:
		tmp = c * (a * (i * -2.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(y * Float64(x * 2.0))
	tmp = 0.0
	if (Float64(x * y) <= -2e+57)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-137)
		tmp = Float64(t * Float64(z * 2.0));
	elseif (Float64(x * y) <= 5e+77)
		tmp = Float64(c * Float64(a * Float64(i * -2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = y * (x * 2.0);
	tmp = 0.0;
	if ((x * y) <= -2e+57)
		tmp = t_1;
	elseif ((x * y) <= 5e-137)
		tmp = t * (z * 2.0);
	elseif ((x * y) <= 5e+77)
		tmp = c * (a * (i * -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[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-137], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+77], N[(c * N[(a * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\
\;\;\;\;c \cdot \left(a \cdot \left(i \cdot -2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.0000000000000001e57 or 5.00000000000000004e77 < (*.f64 x y)

    1. Initial program 91.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 x around inf

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e57 < (*.f64 x y) < 5.00000000000000001e-137

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

    if 5.00000000000000001e-137 < (*.f64 x y) < 5.00000000000000004e77

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 44.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(x \cdot 2\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\ \;\;\;\;t \cdot \left(z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* y (* x 2.0))))
   (if (<= (* x y) -2e+57) t_1 (if (<= (* x y) 5e+77) (* 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 = y * (x * 2.0);
	double tmp;
	if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= 5e+77) {
		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 = y * (x * 2.0d0)
    if ((x * y) <= (-2d+57)) then
        tmp = t_1
    else if ((x * y) <= 5d+77) 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 = y * (x * 2.0);
	double tmp;
	if ((x * y) <= -2e+57) {
		tmp = t_1;
	} else if ((x * y) <= 5e+77) {
		tmp = t * (z * 2.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = y * (x * 2.0)
	tmp = 0
	if (x * y) <= -2e+57:
		tmp = t_1
	elif (x * y) <= 5e+77:
		tmp = t * (z * 2.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(y * Float64(x * 2.0))
	tmp = 0.0
	if (Float64(x * y) <= -2e+57)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e+77)
		tmp = Float64(t * Float64(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 = y * (x * 2.0);
	tmp = 0.0;
	if ((x * y) <= -2e+57)
		tmp = t_1;
	elseif ((x * y) <= 5e+77)
		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[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+77], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.0000000000000001e57 or 5.00000000000000004e77 < (*.f64 x y)

    1. Initial program 91.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 x around inf

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e57 < (*.f64 x y) < 5.00000000000000004e77

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

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

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

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

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

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

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

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

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

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

Alternative 14: 56.7% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.5e113 or 3.2e165 < a

    1. Initial program 82.8%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right) \]
      7. 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)} \]
      8. +-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)} \]
      9. 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) \]
      10. 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)} \]
      11. 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) \]
      12. 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)} \]
    4. Applied rewrites84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(c \cdot \color{blue}{\left(\mathsf{neg}\left(i\right)\right)}\right)\right) \]
      10. lower-neg.f6465.0

        \[\leadsto 2 \cdot \left(a \cdot \left(c \cdot \color{blue}{\left(-i\right)}\right)\right) \]
    10. Applied rewrites65.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot -1\right) \cdot \left(i \cdot c\right)\right)} \cdot a \]
      13. metadata-evalN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(i \cdot c\right) \cdot -2\right)} \cdot a \]
    12. Applied rewrites65.0%

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

    if -1.5e113 < a < 3.2e165

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

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

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

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

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

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

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

Alternative 15: 29.0% accurate, 3.6× speedup?

\[\begin{array}{l} \\ t \cdot \left(z \cdot 2\right) \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(t * Float64(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[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
t \cdot \left(z \cdot 2\right)
\end{array}
Derivation
  1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

Developer Target 1: 94.2% 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 2024214 
(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))))