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

Percentage Accurate: 90.2% → 95.1%
Time: 11.1s
Alternatives: 15
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 95.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.99999999999999983e-106

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999983e-106 < i

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 41.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-139}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 10^{-307}:\\
\;\;\;\;2 \cdot \left(t \cdot z\right)\\

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

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


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

    1. Initial program 78.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-*.f6446.3

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

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

    if -5.00000000000000009e197 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000034e-139 or 9.99999999999999909e-308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e152

    1. Initial program 99.8%

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

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

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

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

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

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

    if -5.00000000000000034e-139 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999909e-308

    1. Initial program 97.8%

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

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

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

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

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

Alternative 3: 39.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ t_2 := 2 \cdot \left(y \cdot x\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+197}:\\ \;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-139}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{-307}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+152}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(i \cdot a\right)\right) \cdot c\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* (+ a (* b c)) c) i)) (t_2 (* 2.0 (* y x))))
   (if (<= t_1 -5e+197)
     (* (* (* a c) i) -2.0)
     (if (<= t_1 -5e-139)
       t_2
       (if (<= t_1 1e-307)
         (* 2.0 (* t z))
         (if (<= t_1 2e+152) t_2 (* (* -2.0 (* i a)) c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double t_2 = 2.0 * (y * x);
	double tmp;
	if (t_1 <= -5e+197) {
		tmp = ((a * c) * i) * -2.0;
	} else if (t_1 <= -5e-139) {
		tmp = t_2;
	} else if (t_1 <= 1e-307) {
		tmp = 2.0 * (t * z);
	} else if (t_1 <= 2e+152) {
		tmp = t_2;
	} else {
		tmp = (-2.0 * (i * a)) * c;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((a + (b * c)) * c) * i
    t_2 = 2.0d0 * (y * x)
    if (t_1 <= (-5d+197)) then
        tmp = ((a * c) * i) * (-2.0d0)
    else if (t_1 <= (-5d-139)) then
        tmp = t_2
    else if (t_1 <= 1d-307) then
        tmp = 2.0d0 * (t * z)
    else if (t_1 <= 2d+152) then
        tmp = t_2
    else
        tmp = ((-2.0d0) * (i * a)) * c
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((a + (b * c)) * c) * i;
	double t_2 = 2.0 * (y * x);
	double tmp;
	if (t_1 <= -5e+197) {
		tmp = ((a * c) * i) * -2.0;
	} else if (t_1 <= -5e-139) {
		tmp = t_2;
	} else if (t_1 <= 1e-307) {
		tmp = 2.0 * (t * z);
	} else if (t_1 <= 2e+152) {
		tmp = t_2;
	} else {
		tmp = (-2.0 * (i * a)) * c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((a + (b * c)) * c) * i
	t_2 = 2.0 * (y * x)
	tmp = 0
	if t_1 <= -5e+197:
		tmp = ((a * c) * i) * -2.0
	elif t_1 <= -5e-139:
		tmp = t_2
	elif t_1 <= 1e-307:
		tmp = 2.0 * (t * z)
	elif t_1 <= 2e+152:
		tmp = t_2
	else:
		tmp = (-2.0 * (i * a)) * c
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
	t_2 = Float64(2.0 * Float64(y * x))
	tmp = 0.0
	if (t_1 <= -5e+197)
		tmp = Float64(Float64(Float64(a * c) * i) * -2.0);
	elseif (t_1 <= -5e-139)
		tmp = t_2;
	elseif (t_1 <= 1e-307)
		tmp = Float64(2.0 * Float64(t * z));
	elseif (t_1 <= 2e+152)
		tmp = t_2;
	else
		tmp = Float64(Float64(-2.0 * Float64(i * a)) * c);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((a + (b * c)) * c) * i;
	t_2 = 2.0 * (y * x);
	tmp = 0.0;
	if (t_1 <= -5e+197)
		tmp = ((a * c) * i) * -2.0;
	elseif (t_1 <= -5e-139)
		tmp = t_2;
	elseif (t_1 <= 1e-307)
		tmp = 2.0 * (t * z);
	elseif (t_1 <= 2e+152)
		tmp = t_2;
	else
		tmp = (-2.0 * (i * a)) * c;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+197], N[(N[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, -5e-139], t$95$2, If[LessEqual[t$95$1, 1e-307], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+152], t$95$2, N[(N[(-2.0 * N[(i * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-139}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{-307}:\\
\;\;\;\;2 \cdot \left(t \cdot z\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 85.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-*.f6445.5

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

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

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

      if -5.00000000000000009e197 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000034e-139 or 9.99999999999999909e-308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e152

      1. Initial program 99.8%

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

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

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

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

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

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

      if -5.00000000000000034e-139 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999909e-308

      1. Initial program 97.8%

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

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

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

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

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

      if 2.0000000000000001e152 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

      1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-2 \cdot \left(a \cdot i\right)\right) \cdot c \]
      7. Step-by-step derivation
        1. Applied rewrites41.7%

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

      Alternative 4: 38.8% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-2 \cdot \left(i \cdot a\right)\right) \cdot c\\ t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\ t_3 := 2 \cdot \left(y \cdot x\right)\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+197}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-139}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 10^{-307}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+152}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (let* ((t_1 (* (* -2.0 (* i a)) c))
              (t_2 (* (* (+ a (* b c)) c) i))
              (t_3 (* 2.0 (* y x))))
         (if (<= t_2 -5e+197)
           t_1
           (if (<= t_2 -5e-139)
             t_3
             (if (<= t_2 1e-307) (* 2.0 (* t z)) (if (<= t_2 2e+152) t_3 t_1))))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (-2.0 * (i * a)) * c;
      	double t_2 = ((a + (b * c)) * c) * i;
      	double t_3 = 2.0 * (y * x);
      	double tmp;
      	if (t_2 <= -5e+197) {
      		tmp = t_1;
      	} else if (t_2 <= -5e-139) {
      		tmp = t_3;
      	} else if (t_2 <= 1e-307) {
      		tmp = 2.0 * (t * z);
      	} else if (t_2 <= 2e+152) {
      		tmp = t_3;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a, b, c, i)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          real(8), intent (in) :: i
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: t_3
          real(8) :: tmp
          t_1 = ((-2.0d0) * (i * a)) * c
          t_2 = ((a + (b * c)) * c) * i
          t_3 = 2.0d0 * (y * x)
          if (t_2 <= (-5d+197)) then
              tmp = t_1
          else if (t_2 <= (-5d-139)) then
              tmp = t_3
          else if (t_2 <= 1d-307) then
              tmp = 2.0d0 * (t * z)
          else if (t_2 <= 2d+152) then
              tmp = t_3
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (-2.0 * (i * a)) * c;
      	double t_2 = ((a + (b * c)) * c) * i;
      	double t_3 = 2.0 * (y * x);
      	double tmp;
      	if (t_2 <= -5e+197) {
      		tmp = t_1;
      	} else if (t_2 <= -5e-139) {
      		tmp = t_3;
      	} else if (t_2 <= 1e-307) {
      		tmp = 2.0 * (t * z);
      	} else if (t_2 <= 2e+152) {
      		tmp = t_3;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b, c, i):
      	t_1 = (-2.0 * (i * a)) * c
      	t_2 = ((a + (b * c)) * c) * i
      	t_3 = 2.0 * (y * x)
      	tmp = 0
      	if t_2 <= -5e+197:
      		tmp = t_1
      	elif t_2 <= -5e-139:
      		tmp = t_3
      	elif t_2 <= 1e-307:
      		tmp = 2.0 * (t * z)
      	elif t_2 <= 2e+152:
      		tmp = t_3
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b, c, i)
      	t_1 = Float64(Float64(-2.0 * Float64(i * a)) * c)
      	t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i)
      	t_3 = Float64(2.0 * Float64(y * x))
      	tmp = 0.0
      	if (t_2 <= -5e+197)
      		tmp = t_1;
      	elseif (t_2 <= -5e-139)
      		tmp = t_3;
      	elseif (t_2 <= 1e-307)
      		tmp = Float64(2.0 * Float64(t * z));
      	elseif (t_2 <= 2e+152)
      		tmp = t_3;
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b, c, i)
      	t_1 = (-2.0 * (i * a)) * c;
      	t_2 = ((a + (b * c)) * c) * i;
      	t_3 = 2.0 * (y * x);
      	tmp = 0.0;
      	if (t_2 <= -5e+197)
      		tmp = t_1;
      	elseif (t_2 <= -5e-139)
      		tmp = t_3;
      	elseif (t_2 <= 1e-307)
      		tmp = 2.0 * (t * z);
      	elseif (t_2 <= 2e+152)
      		tmp = t_3;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * N[(i * a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+197], t$95$1, If[LessEqual[t$95$2, -5e-139], t$95$3, If[LessEqual[t$95$2, 1e-307], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+152], t$95$3, t$95$1]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(-2 \cdot \left(i \cdot a\right)\right) \cdot c\\
      t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
      t_3 := 2 \cdot \left(y \cdot x\right)\\
      \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+197}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-139}:\\
      \;\;\;\;t\_3\\
      
      \mathbf{elif}\;t\_2 \leq 10^{-307}:\\
      \;\;\;\;2 \cdot \left(t \cdot z\right)\\
      
      \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+152}:\\
      \;\;\;\;t\_3\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000009e197 or 2.0000000000000001e152 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

        1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-2 \cdot \left(a \cdot i\right)\right) \cdot c \]
        7. Step-by-step derivation
          1. Applied rewrites42.0%

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

          if -5.00000000000000009e197 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000034e-139 or 9.99999999999999909e-308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e152

          1. Initial program 99.8%

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

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

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

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

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

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

          if -5.00000000000000034e-139 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999909e-308

          1. Initial program 97.8%

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

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

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

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

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

        Alternative 5: 87.8% accurate, 0.5× speedup?

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

          1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -5.0000000000000002e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999996e249

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.9999999999999996e249 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

          1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 6: 82.8% accurate, 0.6× speedup?

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

            1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -5.0000000000000002e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e152

              1. Initial program 99.0%

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

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

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

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

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

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

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

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

            Alternative 7: 81.0% accurate, 0.6× speedup?

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

              1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -5.0000000000000002e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e152

              1. Initial program 99.0%

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

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

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

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

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

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

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

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

            Alternative 8: 83.4% accurate, 0.6× speedup?

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

              1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -4.99999999999999986e-29 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e152

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

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

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

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

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

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

              if 2.0000000000000001e152 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

              1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 74.6% accurate, 0.6× speedup?

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

                1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

                if -2.0000000000000001e243 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999996e249

                1. Initial program 99.1%

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

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

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

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

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

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

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

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

              Alternative 10: 74.8% accurate, 0.6× speedup?

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

                1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
                7. Step-by-step derivation
                  1. Applied rewrites57.2%

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

                  if -2.0000000000000001e243 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999996e249

                  1. Initial program 99.1%

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

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

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

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

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

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

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

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

                Alternative 11: 74.5% accurate, 0.6× speedup?

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

                  1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c \]
                  7. Step-by-step derivation
                    1. Applied rewrites63.9%

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

                    if -2.0000000000000001e243 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999996e249

                    1. Initial program 99.1%

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

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

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

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

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

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

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

                    if 4.9999999999999996e249 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right) \cdot c \]
                    8. Recombined 3 regimes into one program.
                    9. Add Preprocessing

                    Alternative 12: 62.9% accurate, 0.6× speedup?

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

                      1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

                      if -2.0000000000000001e243 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999996e249

                      1. Initial program 99.1%

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

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

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

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

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

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

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

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

                    Alternative 13: 91.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 14: 43.8% accurate, 1.2× speedup?

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

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

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

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

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

                        \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites68.8%

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

                        if -1.00000000000000003e170 < (*.f64 z t) < 5.00000000000000025e141

                        1. Initial program 89.7%

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

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

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

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

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

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

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

                      Alternative 15: 30.0% accurate, 4.4× speedup?

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

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

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

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

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

                        \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites26.4%

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

                        Developer Target 1: 94.3% 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 2024339 
                        (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))))