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

Percentage Accurate: 90.1% → 94.0%
Time: 13.2s
Alternatives: 15
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

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

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+195}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot t\_2\right)\\

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


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

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999998e195

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

    if 4.9999999999999998e195 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 80.3%

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

        \[\leadsto 2 \cdot \left(\left(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-/.f6491.9

        \[\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.f6491.9

        \[\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 rewrites91.9%

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

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

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

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

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

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

Alternative 2: 84.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -1000000000000:\\
\;\;\;\;t\_2\\

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

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


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

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e12 or 2.0000000000000001e-18 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e12 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e-18

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq -\infty:\\ \;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\ \mathbf{elif}\;i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq -1000000000000:\\ \;\;\;\;\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^{-18}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.6% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 95.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-/.f6498.0

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

        \[\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 rewrites98.0%

      \[\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) \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

Alternative 4: 87.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), \left(-i\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 -1000000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(\left(-c\right) \cdot b, i \cdot c, \mathsf{fma}\left(y, x, t \cdot z\right)\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) < -1e12 or 5.0000000000000002e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, z \cdot t\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites88.8%

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

      if -1e12 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e70

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 85.8% accurate, 0.5× speedup?

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

      1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1e12 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e-18

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq -1000000000000:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), \left(-i\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^{-18}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), \left(-i\right) \cdot c, t \cdot z\right) \cdot 2\\ \end{array} \]
      9. Add Preprocessing

      Alternative 6: 79.9% accurate, 0.6× speedup?

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

        1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

        if -1.9999999999999999e33 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999997e106

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      Alternative 7: 73.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^{+304}:\\ \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+190}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot -2\right) \cdot b\\ \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+304)
           (* (* (* -2.0 b) (* i c)) c)
           (if (<= t_1 5e+190)
             (* (fma y x (* t z)) 2.0)
             (* (* (* (* c c) i) -2.0) b)))))
      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+304) {
      		tmp = ((-2.0 * b) * (i * c)) * c;
      	} else if (t_1 <= 5e+190) {
      		tmp = fma(y, x, (t * z)) * 2.0;
      	} else {
      		tmp = (((c * c) * i) * -2.0) * b;
      	}
      	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+304)
      		tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c);
      	elseif (t_1 <= 5e+190)
      		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
      	else
      		tmp = Float64(Float64(Float64(Float64(c * c) * i) * -2.0) * b);
      	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+304], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 5e+190], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * b), $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^{+304}:\\
      \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
      
      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+190}:\\
      \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot -2\right) \cdot b\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999997e304

        1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

          if -4.9999999999999997e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e190

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

          if 5.00000000000000036e190 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

          1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 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 -5 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+155}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot i\right) \cdot \left(\left(c \cdot b\right) \cdot c\right)\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c i)
         :precision binary64
         (let* ((t_1 (* i (* (+ (* c b) a) c))))
           (if (<= t_1 -5e+304)
             (* (* (* -2.0 b) (* i c)) c)
             (if (<= t_1 2e+155)
               (* (fma y x (* t z)) 2.0)
               (* (* -2.0 i) (* (* c b) c))))))
        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = i * (((c * b) + a) * c);
        	double tmp;
        	if (t_1 <= -5e+304) {
        		tmp = ((-2.0 * b) * (i * c)) * c;
        	} else if (t_1 <= 2e+155) {
        		tmp = fma(y, x, (t * z)) * 2.0;
        	} else {
        		tmp = (-2.0 * i) * ((c * b) * 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 <= -5e+304)
        		tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c);
        	elseif (t_1 <= 2e+155)
        		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
        	else
        		tmp = Float64(Float64(-2.0 * i) * Float64(Float64(c * b) * 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, -5e+304], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 2e+155], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(-2.0 * i), $MachinePrecision] * N[(N[(c * b), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+304}:\\
        \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
        
        \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+155}:\\
        \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(-2 \cdot i\right) \cdot \left(\left(c \cdot b\right) \cdot c\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999997e304

          1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

            if -4.9999999999999997e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e155

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

            if 2.00000000000000001e155 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(c \cdot b\right) \cdot c\right) \cdot \color{blue}{\left(-2 \cdot i\right)} \]
              3. Recombined 3 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 -5 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\ \mathbf{elif}\;i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq 2 \cdot 10^{+155}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot i\right) \cdot \left(\left(c \cdot b\right) \cdot c\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 73.0% accurate, 0.6× speedup?

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

                1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

                  if -4.9999999999999997e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e155

                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

                  if 2.00000000000000001e155 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 10: 72.8% 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^{+304}:\\ \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+155}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-2 \cdot i\right) \cdot b\right) \cdot \left(c \cdot c\right)\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (let* ((t_1 (* i (* (+ (* c b) a) c))))
                         (if (<= t_1 -5e+304)
                           (* (* (* -2.0 b) (* i c)) c)
                           (if (<= t_1 2e+155)
                             (* (fma y x (* t z)) 2.0)
                             (* (* (* -2.0 i) b) (* c 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 <= -5e+304) {
                      		tmp = ((-2.0 * b) * (i * c)) * c;
                      	} else if (t_1 <= 2e+155) {
                      		tmp = fma(y, x, (t * z)) * 2.0;
                      	} else {
                      		tmp = ((-2.0 * i) * b) * (c * 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 <= -5e+304)
                      		tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c);
                      	elseif (t_1 <= 2e+155)
                      		tmp = Float64(fma(y, x, Float64(t * z)) * 2.0);
                      	else
                      		tmp = Float64(Float64(Float64(-2.0 * i) * b) * Float64(c * 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, -5e+304], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 2e+155], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(-2.0 * i), $MachinePrecision] * b), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                      \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+304}:\\
                      \;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
                      
                      \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+155}:\\
                      \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(\left(-2 \cdot i\right) \cdot b\right) \cdot \left(c \cdot c\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999997e304

                        1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

                          if -4.9999999999999997e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e155

                          1. Initial program 99.9%

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

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

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

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

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

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

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

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

                          if 2.00000000000000001e155 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 11: 73.7% accurate, 0.6× speedup?

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

                            1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

                              if -4.9999999999999997e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e190

                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

                            Alternative 12: 63.0% accurate, 0.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+261}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+190}:\\ \;\;\;\;\mathsf{fma}\left(y, x, 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 (* (* (* i c) a) -2.0)) (t_2 (* i (* (+ (* c b) a) c))))
                               (if (<= t_2 -4e+261)
                                 t_1
                                 (if (<= t_2 2e+190) (* (fma y x (* 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 = ((i * c) * a) * -2.0;
                            	double t_2 = i * (((c * b) + a) * c);
                            	double tmp;
                            	if (t_2 <= -4e+261) {
                            		tmp = t_1;
                            	} else if (t_2 <= 2e+190) {
                            		tmp = fma(y, x, (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(i * c) * a) * -2.0)
                            	t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                            	tmp = 0.0
                            	if (t_2 <= -4e+261)
                            		tmp = t_1;
                            	elseif (t_2 <= 2e+190)
                            		tmp = Float64(fma(y, x, 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[(i * c), $MachinePrecision] * a), $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, -4e+261], t$95$1, If[LessEqual[t$95$2, 2e+190], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                            t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                            \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+261}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+190}:\\
                            \;\;\;\;\mathsf{fma}\left(y, x, 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) < -3.9999999999999997e261 or 2.0000000000000001e190 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                              1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

                              if -3.9999999999999997e261 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e190

                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq -4 \cdot 10^{+261}:\\ \;\;\;\;\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^{+190}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 13: 92.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 -\infty:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), \left(-i\right) \cdot c, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(t \cdot z + y \cdot x\right) - t\_1\right)\\ \end{array} \end{array} \]
                            (FPCore (x y z t a b c i)
                             :precision binary64
                             (let* ((t_1 (* i (* (+ (* c b) a) c))))
                               (if (<= t_1 (- INFINITY))
                                 (* (fma (fma b c a) (* (- i) c) (* t z)) 2.0)
                                 (* 2.0 (- (+ (* t z) (* y x)) t_1)))))
                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                            	double t_1 = i * (((c * b) + a) * c);
                            	double tmp;
                            	if (t_1 <= -((double) INFINITY)) {
                            		tmp = fma(fma(b, c, a), (-i * c), (t * z)) * 2.0;
                            	} else {
                            		tmp = 2.0 * (((t * z) + (y * x)) - t_1);
                            	}
                            	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 <= Float64(-Inf))
                            		tmp = Float64(fma(fma(b, c, a), Float64(Float64(-i) * c), Float64(t * z)) * 2.0);
                            	else
                            		tmp = Float64(2.0 * Float64(Float64(Float64(t * z) + Float64(y * x)) - t_1));
                            	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, (-Infinity)], N[(N[(N[(b * c + a), $MachinePrecision] * N[((-i) * c), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                            \mathbf{if}\;t\_1 \leq -\infty:\\
                            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), \left(-i\right) \cdot c, t \cdot z\right) \cdot 2\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;2 \cdot \left(\left(t \cdot z + y \cdot x\right) - t\_1\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0

                              1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                1. Initial program 94.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
                              7. Recombined 2 regimes into one program.
                              8. Final simplification94.6%

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

                              Alternative 14: 44.2% accurate, 1.2× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t \cdot z\right) \cdot 2\\ \mathbf{if}\;t \cdot z \leq -2.4 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 1.8 \cdot 10^{+42}:\\ \;\;\;\;\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 (* (* t z) 2.0)))
                                 (if (<= (* t z) -2.4e+27)
                                   t_1
                                   (if (<= (* t z) 1.8e+42) (* (* 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 = (t * z) * 2.0;
                              	double tmp;
                              	if ((t * z) <= -2.4e+27) {
                              		tmp = t_1;
                              	} else if ((t * z) <= 1.8e+42) {
                              		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 = (t * z) * 2.0d0
                                  if ((t * z) <= (-2.4d+27)) then
                                      tmp = t_1
                                  else if ((t * z) <= 1.8d+42) 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 = (t * z) * 2.0;
                              	double tmp;
                              	if ((t * z) <= -2.4e+27) {
                              		tmp = t_1;
                              	} else if ((t * z) <= 1.8e+42) {
                              		tmp = (y * x) * 2.0;
                              	} else {
                              		tmp = t_1;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t, a, b, c, i):
                              	t_1 = (t * z) * 2.0
                              	tmp = 0
                              	if (t * z) <= -2.4e+27:
                              		tmp = t_1
                              	elif (t * z) <= 1.8e+42:
                              		tmp = (y * x) * 2.0
                              	else:
                              		tmp = t_1
                              	return tmp
                              
                              function code(x, y, z, t, a, b, c, i)
                              	t_1 = Float64(Float64(t * z) * 2.0)
                              	tmp = 0.0
                              	if (Float64(t * z) <= -2.4e+27)
                              		tmp = t_1;
                              	elseif (Float64(t * z) <= 1.8e+42)
                              		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 = (t * z) * 2.0;
                              	tmp = 0.0;
                              	if ((t * z) <= -2.4e+27)
                              		tmp = t_1;
                              	elseif ((t * z) <= 1.8e+42)
                              		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[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -2.4e+27], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 1.8e+42], N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := \left(t \cdot z\right) \cdot 2\\
                              \mathbf{if}\;t \cdot z \leq -2.4 \cdot 10^{+27}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;t \cdot z \leq 1.8 \cdot 10^{+42}:\\
                              \;\;\;\;\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) < -2.39999999999999998e27 or 1.8e42 < (*.f64 z t)

                                1. Initial program 90.0%

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

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

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

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

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

                                if -2.39999999999999998e27 < (*.f64 z t) < 1.8e42

                                1. Initial program 91.9%

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

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

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

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

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

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

                              Alternative 15: 29.2% accurate, 3.6× speedup?

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

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

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

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

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

                                \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
                              6. Final simplification28.9%

                                \[\leadsto \left(y \cdot x\right) \cdot 2 \]
                              7. Add Preprocessing

                              Developer Target 1: 93.9% 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 2024256 
                              (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))))