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

Percentage Accurate: 90.4% → 95.4%
Time: 10.3s
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: 95.4% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e205 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999995e196

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

    if 9.9999999999999995e196 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;t\_2 \leq 10^{+296}:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000001e26 or 5e17 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999981e295

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e26 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5e17

    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. lower-*.f64N/A

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

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

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

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

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

Alternative 3: 86.9% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000001e26 or 9.99999999999999981e295 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e26 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5e17

    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. lower-*.f64N/A

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

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

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

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

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

    if 5e17 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999981e295

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 88.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e26 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e85

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \leq \infty:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(\left(-i\right) \cdot \mathsf{fma}\left(c, b, a\right), c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i)) INFINITY)
   (* 2.0 (fma z t (fma (* (- i) (fma c b a)) c (* y x))))
   (* 2.0 (fma z t (* (- c) (* (fma b c a) 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)) - (((a + (b * c)) * c) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * fma(z, t, fma((-i * fma(c, b, a)), c, (y * x)));
	} else {
		tmp = 2.0 * fma(z, t, (-c * (fma(b, c, a) * 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(Float64(a + Float64(b * c)) * c) * i)) <= Inf)
		tmp = Float64(2.0 * fma(z, t, fma(Float64(Float64(-i) * fma(c, b, a)), c, Float64(y * x))));
	else
		tmp = Float64(2.0 * fma(z, t, Float64(Float64(-c) * Float64(fma(b, c, a) * 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[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(z * t + N[(N[((-i) * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * c + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\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 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.2% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999992e72 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000003e184

    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. lower-*.f64N/A

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

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

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

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

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

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

Alternative 7: 74.4% accurate, 0.6× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e275

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

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

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

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

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

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

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

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

Alternative 8: 74.8% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e275

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

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

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

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

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

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

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

    if 5.0000000000000003e275 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 64.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e275

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

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

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

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

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

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

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

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

Alternative 10: 64.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e275

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    6. 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. +-commutativeN/A

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

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

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

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

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

Alternative 11: 42.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-319}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -4.99999999999999999e97 or 5.0000000000000001e142 < (*.f64 z t)

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

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

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

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

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

    if -4.99999999999999999e97 < (*.f64 z t) < -1.99998e-319 or 1.99999999999999991e-44 < (*.f64 z t) < 5.0000000000000001e142

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

    if -1.99998e-319 < (*.f64 z t) < 1.99999999999999991e-44

    1. Initial program 89.6%

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

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

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

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

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

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

Alternative 12: 41.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-319}:\\
\;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 z t) < -4.99999999999999999e97 or 5.0000000000000001e142 < (*.f64 z t)

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

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

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

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

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

    if -4.99999999999999999e97 < (*.f64 z t) < -1.99998e-319

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

      if -1.99998e-319 < (*.f64 z t) < 1.99999999999999991e-44

      1. Initial program 89.6%

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

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

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

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

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

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

      if 1.99999999999999991e-44 < (*.f64 z t) < 5.0000000000000001e142

      1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(a \cdot i\right) \cdot c\right) \cdot -2 \]
      7. Recombined 4 regimes into one program.
      8. Add Preprocessing

      Alternative 13: 42.3% accurate, 0.9× speedup?

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

        1. Initial program 85.9%

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

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

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

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

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

        if -4.99999999999999999e97 < (*.f64 z t) < -1.99998e-319

        1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

          if -1.99998e-319 < (*.f64 z t) < 4e129

          1. Initial program 87.7%

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

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

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

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

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

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

        Alternative 14: 45.4% accurate, 1.2× speedup?

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

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

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

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

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

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

          if -4.99999999999999963e74 < (*.f64 z t) < 4e129

          1. Initial program 88.6%

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

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

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

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

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

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

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

        Alternative 15: 28.8% accurate, 3.6× speedup?

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

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

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

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

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

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

        Developer Target 1: 94.4% 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 2024318 
        (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))))