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

Percentage Accurate: 90.4% → 97.0%
Time: 11.7s
Alternatives: 14
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

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

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

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

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


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

    1. Initial program 96.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. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.9% accurate, 0.4× speedup?

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

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

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

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

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


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

    1. Initial program 82.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. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e41

    1. Initial program 97.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000001e41 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e285

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.2%

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

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

        \[\leadsto -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.f6489.0

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

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

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

Alternative 3: 86.9% accurate, 0.4× speedup?

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

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

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

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

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


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

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e41

    1. Initial program 97.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000001e41 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e285

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.2%

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

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

        \[\leadsto -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.f6489.0

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

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

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

Alternative 4: 83.8% accurate, 0.4× speedup?

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

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

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

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

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


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

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e41

    1. Initial program 97.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. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000001e41 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e285

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.2%

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

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

        \[\leadsto -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.f6489.0

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

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

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

Alternative 5: 83.3% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999995e196 or 1.99999999999999993e90 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e277

    1. Initial program 84.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999993e90

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 79.3%

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

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

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

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

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

    if -1.0000000000000001e276 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e114

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 72.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 79.5%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\frac{{a}^{3} + {\left(b \cdot c\right)}^{3}}{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}}\right) \]
      7. clear-numN/A

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\frac{1}{\frac{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}{{a}^{3} + {\left(b \cdot c\right)}^{3}}}}\right) \]
      8. un-div-invN/A

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{\color{blue}{i \cdot c}}{\frac{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}{{a}^{3} + {\left(b \cdot c\right)}^{3}}}\right) \]
      12. clear-numN/A

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{i \cdot c}{\frac{1}{\color{blue}{a + b \cdot c}}}\right) \]
      15. lower-/.f6488.8

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{i \cdot c}{\frac{1}{\color{blue}{c \cdot b} + a}}\right) \]
      20. lower-fma.f6488.8

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.9999999999999998e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e114

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      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 -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-*.f6463.5

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

        \[\leadsto \color{blue}{\left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c} \]
    9. Recombined 3 regimes into one program.
    10. Final simplification78.5%

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

    Alternative 8: 72.4% accurate, 0.6× speedup?

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

      1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-c\right) \cdot i, \mathsf{fma}\left(t, z, 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-*.f6476.2

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

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

      if -9.9999999999999998e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e114

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      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 -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-*.f6463.5

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

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

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

    Alternative 9: 72.1% accurate, 0.6× speedup?

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

      1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), \left(-c\right) \cdot i, \mathsf{fma}\left(t, z, 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-*.f6468.4

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

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

      if -9.9999999999999998e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e114

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 10: 61.7% accurate, 0.6× speedup?

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

      1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

      if -4.99999999999999976e270 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999993e90

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.99999999999999993e90 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 78.6%

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\frac{{a}^{3} + {\left(b \cdot c\right)}^{3}}{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}}\right) \]
        7. clear-numN/A

          \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\frac{1}{\frac{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}{{a}^{3} + {\left(b \cdot c\right)}^{3}}}}\right) \]
        8. un-div-invN/A

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

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

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

          \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{\color{blue}{i \cdot c}}{\frac{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}{{a}^{3} + {\left(b \cdot c\right)}^{3}}}\right) \]
        12. clear-numN/A

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

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

          \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{i \cdot c}{\frac{1}{\color{blue}{a + b \cdot c}}}\right) \]
        15. lower-/.f6488.1

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{i \cdot c}{\frac{1}{\color{blue}{c \cdot b} + a}}\right) \]
        20. lower-fma.f6488.1

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

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

        \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
      6. 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. lower-*.f6439.5

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

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

          \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]
      9. Recombined 3 regimes into one program.
      10. Final simplification65.0%

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

      Alternative 11: 44.3% accurate, 0.8× speedup?

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

        1. Initial program 84.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 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-*.f6460.9

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

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

        if -2e86 < (*.f64 z t) < 4e16

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

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

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

        if 4e16 < (*.f64 z t) < 1e110

        1. Initial program 94.7%

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\frac{{a}^{3} + {\left(b \cdot c\right)}^{3}}{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}}\right) \]
          7. clear-numN/A

            \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\frac{1}{\frac{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}{{a}^{3} + {\left(b \cdot c\right)}^{3}}}}\right) \]
          8. un-div-invN/A

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

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

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

            \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{\color{blue}{i \cdot c}}{\frac{a \cdot a + \left(\left(b \cdot c\right) \cdot \left(b \cdot c\right) - a \cdot \left(b \cdot c\right)\right)}{{a}^{3} + {\left(b \cdot c\right)}^{3}}}\right) \]
          12. clear-numN/A

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

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

            \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{i \cdot c}{\frac{1}{\color{blue}{a + b \cdot c}}}\right) \]
          15. lower-/.f6499.8

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

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

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

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

            \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \frac{i \cdot c}{\frac{1}{\color{blue}{c \cdot b} + a}}\right) \]
          20. lower-fma.f6499.8

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

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

          \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
        6. 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. lower-*.f6444.9

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

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

            \[\leadsto \left(\left(a \cdot c\right) \cdot i\right) \cdot -2 \]
        9. Recombined 3 regimes into one program.
        10. Final simplification49.4%

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

        Alternative 12: 93.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 13: 44.5% accurate, 1.2× speedup?

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

          1. Initial program 84.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 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-*.f6460.9

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

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

          if -2e86 < (*.f64 z t) < 1e110

          1. Initial program 91.1%

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

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

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

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

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

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

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

        Alternative 14: 29.0% 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 89.0%

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

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

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

        Developer Target 1: 94.7% 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 2024331 
        (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))))