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

Percentage Accurate: 89.4% → 95.2%
Time: 15.2s
Alternatives: 12
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 89.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.2% accurate, 1.1× speedup?

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

\\
2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), -c \cdot i, \mathsf{fma}\left(z, t, x \cdot y\right)\right)
\end{array}
Derivation
  1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.5% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000004e-19 or 2.00000000000000012e136 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000004e-19 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000012e136

    1. Initial program 96.9%

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

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

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

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

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

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

Alternative 3: 82.4% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

    if -5.0000000000000004e-19 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e177

    1. Initial program 97.0%

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

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

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

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

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

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

Alternative 4: 81.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999995e131 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e177

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

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

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

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

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

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

Alternative 5: 71.8% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 78.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 b around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.9999999999999999e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e177

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

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

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

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

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

      if 1e177 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 73.2% accurate, 0.6× speedup?

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

      1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -5.0000000000000002e221 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e177

        1. Initial program 97.7%

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

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

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

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

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

        if 1e177 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

        1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{c \cdot \left(-2 \cdot \left(i \cdot \left(c \cdot b\right)\right)\right)} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification74.0%

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

      Alternative 7: 73.7% accurate, 0.6× speedup?

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

        1. Initial program 76.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 b around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -5.0000000000000002e221 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e177

          1. Initial program 97.7%

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

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

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

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

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

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

        Alternative 8: 73.2% accurate, 0.6× speedup?

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

          1. Initial program 76.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 b around inf

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

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

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

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

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

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

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

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

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

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

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

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

          if -5.0000000000000002e221 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999995e211

          1. Initial program 97.7%

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

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

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

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

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

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

        Alternative 9: 63.1% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -5.0000000000000002e221 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e220

          1. Initial program 97.7%

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

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

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

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

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

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

        Alternative 10: 42.6% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := 2 \cdot \left(x \cdot y\right)\\ \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+55}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 9.8 \cdot 10^{-250}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 1.06 \cdot 10^{-14}:\\ \;\;\;\;a \cdot \left(c \cdot \left(i \cdot -2\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c i)
         :precision binary64
         (let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
           (if (<= (* x y) -5.2e+55)
             t_2
             (if (<= (* x y) 9.8e-250)
               t_1
               (if (<= (* x y) 1.06e-14)
                 (* a (* c (* i -2.0)))
                 (if (<= (* x y) 1e+154) 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 = 2.0 * (z * t);
        	double t_2 = 2.0 * (x * y);
        	double tmp;
        	if ((x * y) <= -5.2e+55) {
        		tmp = t_2;
        	} else if ((x * y) <= 9.8e-250) {
        		tmp = t_1;
        	} else if ((x * y) <= 1.06e-14) {
        		tmp = a * (c * (i * -2.0));
        	} else if ((x * y) <= 1e+154) {
        		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 = 2.0d0 * (z * t)
            t_2 = 2.0d0 * (x * y)
            if ((x * y) <= (-5.2d+55)) then
                tmp = t_2
            else if ((x * y) <= 9.8d-250) then
                tmp = t_1
            else if ((x * y) <= 1.06d-14) then
                tmp = a * (c * (i * (-2.0d0)))
            else if ((x * y) <= 1d+154) 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 = 2.0 * (z * t);
        	double t_2 = 2.0 * (x * y);
        	double tmp;
        	if ((x * y) <= -5.2e+55) {
        		tmp = t_2;
        	} else if ((x * y) <= 9.8e-250) {
        		tmp = t_1;
        	} else if ((x * y) <= 1.06e-14) {
        		tmp = a * (c * (i * -2.0));
        	} else if ((x * y) <= 1e+154) {
        		tmp = t_1;
        	} else {
        		tmp = t_2;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b, c, i):
        	t_1 = 2.0 * (z * t)
        	t_2 = 2.0 * (x * y)
        	tmp = 0
        	if (x * y) <= -5.2e+55:
        		tmp = t_2
        	elif (x * y) <= 9.8e-250:
        		tmp = t_1
        	elif (x * y) <= 1.06e-14:
        		tmp = a * (c * (i * -2.0))
        	elif (x * y) <= 1e+154:
        		tmp = t_1
        	else:
        		tmp = t_2
        	return tmp
        
        function code(x, y, z, t, a, b, c, i)
        	t_1 = Float64(2.0 * Float64(z * t))
        	t_2 = Float64(2.0 * Float64(x * y))
        	tmp = 0.0
        	if (Float64(x * y) <= -5.2e+55)
        		tmp = t_2;
        	elseif (Float64(x * y) <= 9.8e-250)
        		tmp = t_1;
        	elseif (Float64(x * y) <= 1.06e-14)
        		tmp = Float64(a * Float64(c * Float64(i * -2.0)));
        	elseif (Float64(x * y) <= 1e+154)
        		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 = 2.0 * (z * t);
        	t_2 = 2.0 * (x * y);
        	tmp = 0.0;
        	if ((x * y) <= -5.2e+55)
        		tmp = t_2;
        	elseif ((x * y) <= 9.8e-250)
        		tmp = t_1;
        	elseif ((x * y) <= 1.06e-14)
        		tmp = a * (c * (i * -2.0));
        	elseif ((x * y) <= 1e+154)
        		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[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.2e+55], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9.8e-250], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.06e-14], N[(a * N[(c * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+154], t$95$1, t$95$2]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := 2 \cdot \left(z \cdot t\right)\\
        t_2 := 2 \cdot \left(x \cdot y\right)\\
        \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+55}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;x \cdot y \leq 9.8 \cdot 10^{-250}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \cdot y \leq 1.06 \cdot 10^{-14}:\\
        \;\;\;\;a \cdot \left(c \cdot \left(i \cdot -2\right)\right)\\
        
        \mathbf{elif}\;x \cdot y \leq 10^{+154}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 x y) < -5.2e55 or 1.00000000000000004e154 < (*.f64 x y)

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

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

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

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

          if -5.2e55 < (*.f64 x y) < 9.79999999999999941e-250 or 1.06e-14 < (*.f64 x y) < 1.00000000000000004e154

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

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

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

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

          if 9.79999999999999941e-250 < (*.f64 x y) < 1.06e-14

          1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+55}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \cdot y \leq 9.8 \cdot 10^{-250}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 1.06 \cdot 10^{-14}:\\ \;\;\;\;a \cdot \left(c \cdot \left(i \cdot -2\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+154}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 11: 44.3% accurate, 1.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y\right)\\ \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{+154}:\\ \;\;\;\;2 \cdot \left(z \cdot t\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 (* x y))))
           (if (<= (* x y) -5.2e+55)
             t_1
             (if (<= (* x y) 1e+154) (* 2.0 (* z t)) 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 * (x * y);
        	double tmp;
        	if ((x * y) <= -5.2e+55) {
        		tmp = t_1;
        	} else if ((x * y) <= 1e+154) {
        		tmp = 2.0 * (z * t);
        	} 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 * (x * y)
            if ((x * y) <= (-5.2d+55)) then
                tmp = t_1
            else if ((x * y) <= 1d+154) then
                tmp = 2.0d0 * (z * t)
            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 * (x * y);
        	double tmp;
        	if ((x * y) <= -5.2e+55) {
        		tmp = t_1;
        	} else if ((x * y) <= 1e+154) {
        		tmp = 2.0 * (z * t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b, c, i):
        	t_1 = 2.0 * (x * y)
        	tmp = 0
        	if (x * y) <= -5.2e+55:
        		tmp = t_1
        	elif (x * y) <= 1e+154:
        		tmp = 2.0 * (z * t)
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t, a, b, c, i)
        	t_1 = Float64(2.0 * Float64(x * y))
        	tmp = 0.0
        	if (Float64(x * y) <= -5.2e+55)
        		tmp = t_1;
        	elseif (Float64(x * y) <= 1e+154)
        		tmp = Float64(2.0 * Float64(z * t));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b, c, i)
        	t_1 = 2.0 * (x * y);
        	tmp = 0.0;
        	if ((x * y) <= -5.2e+55)
        		tmp = t_1;
        	elseif ((x * y) <= 1e+154)
        		tmp = 2.0 * (z * t);
        	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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.2e+55], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+154], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := 2 \cdot \left(x \cdot y\right)\\
        \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+55}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \cdot y \leq 10^{+154}:\\
        \;\;\;\;2 \cdot \left(z \cdot t\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 x y) < -5.2e55 or 1.00000000000000004e154 < (*.f64 x y)

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

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

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

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

          if -5.2e55 < (*.f64 x y) < 1.00000000000000004e154

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

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

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

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

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

        Alternative 12: 29.4% accurate, 3.6× speedup?

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

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

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

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

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

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

        Developer Target 1: 94.0% 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 2024226 
        (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))))