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

Percentage Accurate: 90.2% → 96.2%
Time: 14.4s
Alternatives: 14
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := z \cdot t + x \cdot y\\ \mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (+ (* z t) (* x y))))
   (if (<= (- t_2 (* i (* c t_1))) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* -2.0 (* c (* c (+ (* b i) (/ (* 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);
	double t_2 = (z * t) + (x * y);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c))));
	}
	return tmp;
}
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);
	double t_2 = (z * t) + (x * y);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = (z * t) + (x * y)
	tmp = 0
	if (t_2 - (i * (c * t_1))) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(z * t) + Float64(x * y))
	tmp = 0.0
	if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(Float64(b * i) + Float64(Float64(a * i) / c)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (z * t) + (x * y);
	tmp = 0.0;
	if ((t_2 - (i * (c * t_1))) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = -2.0 * (c * (c * ((b * i) + ((a * i) / c))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(c * N[(N[(b * i), $MachinePrecision] + N[(N[(a * i), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 93.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. Step-by-step derivation
      1. fma-define93.8%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*99.5%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define99.5%

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

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

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

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

    1. Initial program 0.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+0.0%

        \[\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)} \]
      2. *-commutative0.0%

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + t \cdot z\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      4. associate--l+0.0%

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

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

        \[\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)} \]
      7. fma-define9.1%

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

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

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

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

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

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

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

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

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

Alternative 2: 94.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\mathsf{fma}\left(x, 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 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 89.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. Step-by-step derivation
    1. fma-define90.2%

      \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. associate-*l*96.4%

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

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

Alternative 3: 86.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-58} \lor \neg \left(z \cdot t \leq 4 \cdot 10^{-76}\right):\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -4.99999999999999977e-58 or 3.99999999999999971e-76 < (*.f64 z t)

    1. Initial program 89.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define89.6%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*95.3%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define94.6%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr94.6%

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    7. Taylor expanded in a around 0 89.2%

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

    if -4.99999999999999977e-58 < (*.f64 z t) < 3.99999999999999971e-76

    1. Initial program 90.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define90.9%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*98.0%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define98.0%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr98.0%

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    7. Taylor expanded in z around inf 81.2%

      \[\leadsto 2 \cdot \left(\color{blue}{z \cdot \left(t + \frac{x \cdot y}{z}\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    8. Taylor expanded in z around 0 98.0%

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

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

Alternative 4: 85.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-58} \lor \neg \left(z \cdot t \leq 4 \cdot 10^{-76}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t + \left(x \cdot y - b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -4.99999999999999977e-58 or 3.99999999999999971e-76 < (*.f64 z t)

    1. Initial program 89.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define89.6%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*95.3%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define94.6%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr94.6%

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    7. Taylor expanded in a around 0 89.2%

      \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\left(b \cdot c\right)} \cdot \left(c \cdot i\right)\right) \]
    8. Step-by-step derivation
      1. associate--l+89.2%

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot t + \left(x \cdot y - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\right)} \]
      2. associate-*l*86.6%

        \[\leadsto 2 \cdot \left(z \cdot t + \left(x \cdot y - \color{blue}{b \cdot \left(c \cdot \left(c \cdot i\right)\right)}\right)\right) \]
    9. Applied egg-rr86.6%

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

    if -4.99999999999999977e-58 < (*.f64 z t) < 3.99999999999999971e-76

    1. Initial program 90.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define90.9%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*98.0%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define98.0%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr98.0%

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    7. Taylor expanded in z around inf 81.2%

      \[\leadsto 2 \cdot \left(\color{blue}{z \cdot \left(t + \frac{x \cdot y}{z}\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    8. Taylor expanded in z around 0 98.0%

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

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

Alternative 5: 90.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999993e260

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

    if 9.9999999999999993e260 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 58.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. Step-by-step derivation
      1. fma-define61.2%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*94.8%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define92.2%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr92.2%

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    7. Taylor expanded in a around 0 89.9%

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

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

Alternative 6: 87.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3300000000000 \lor \neg \left(c \leq 1.3 \cdot 10^{+15}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -3300000000000.0) (not (<= c 1.3e+15)))
   (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
   (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -3300000000000.0) || !(c <= 1.3e+15)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = 2.0 * (((z * t) + (x * y)) - (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) :: tmp
    if ((c <= (-3300000000000.0d0)) .or. (.not. (c <= 1.3d+15))) then
        tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
    else
        tmp = 2.0d0 * (((z * t) + (x * y)) - (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 tmp;
	if ((c <= -3300000000000.0) || !(c <= 1.3e+15)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -3300000000000.0) or not (c <= 1.3e+15):
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)))
	else:
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -3300000000000.0) || !(c <= 1.3e+15))
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -3300000000000.0) || ~((c <= 1.3e+15)))
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	else
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3300000000000.0], N[Not[LessEqual[c, 1.3e+15]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3300000000000 \lor \neg \left(c \leq 1.3 \cdot 10^{+15}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.3e12 or 1.3e15 < c

    1. Initial program 77.6%

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

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

    if -3.3e12 < c < 1.3e15

    1. Initial program 99.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 a around inf 93.2%

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a \cdot c\right)} \cdot i\right) \]
    4. Step-by-step derivation
      1. *-commutative93.2%

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

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

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

Alternative 7: 79.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -6.9 \cdot 10^{-16} \lor \neg \left(c \leq 7.3 \cdot 10^{-124}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -6.9e-16) (not (<= c 7.3e-124)))
   (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
   (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -6.9e-16) || !(c <= 7.3e-124)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	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 ((c <= (-6.9d-16)) .or. (.not. (c <= 7.3d-124))) then
        tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
    else
        tmp = 2.0d0 * ((z * t) + (x * y))
    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 ((c <= -6.9e-16) || !(c <= 7.3e-124)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -6.9e-16) or not (c <= 7.3e-124):
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)))
	else:
		tmp = 2.0 * ((z * t) + (x * y))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -6.9e-16) || !(c <= 7.3e-124))
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))));
	else
		tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -6.9e-16) || ~((c <= 7.3e-124)))
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	else
		tmp = 2.0 * ((z * t) + (x * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.9e-16], N[Not[LessEqual[c, 7.3e-124]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.9 \cdot 10^{-16} \lor \neg \left(c \leq 7.3 \cdot 10^{-124}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -6.8999999999999997e-16 or 7.3e-124 < c

    1. Initial program 82.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 0 82.3%

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

    if -6.8999999999999997e-16 < c < 7.3e-124

    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 82.7%

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

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

Alternative 8: 72.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+117}:\\
\;\;\;\;z \cdot \left(2 \cdot \left(t + x \cdot \frac{y}{z}\right)\right)\\

\mathbf{elif}\;z \leq 5.1 \cdot 10^{-109}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.49999999999999992e117

    1. Initial program 85.6%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in z around inf 77.1%

      \[\leadsto \color{blue}{z \cdot \left(2 \cdot t + 2 \cdot \frac{x \cdot y}{z}\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-out77.1%

        \[\leadsto z \cdot \color{blue}{\left(2 \cdot \left(t + \frac{x \cdot y}{z}\right)\right)} \]
      2. associate-/l*79.9%

        \[\leadsto z \cdot \left(2 \cdot \left(t + \color{blue}{x \cdot \frac{y}{z}}\right)\right) \]
    6. Simplified79.9%

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

    if -2.49999999999999992e117 < z < 5.10000000000000041e-109

    1. Initial program 93.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. Step-by-step derivation
      1. fma-define93.6%

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*98.4%

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define98.4%

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

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

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    7. Taylor expanded in z around inf 84.2%

      \[\leadsto 2 \cdot \left(\color{blue}{z \cdot \left(t + \frac{x \cdot y}{z}\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    8. Taylor expanded in z around 0 85.2%

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

    if 5.10000000000000041e-109 < z

    1. Initial program 85.5%

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

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

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

Alternative 9: 72.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -5.5 \cdot 10^{+122} \lor \neg \left(c \leq 1.35 \cdot 10^{+15}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -5.5e+122) (not (<= c 1.35e+15)))
   (* 2.0 (- (* x y) (* c (* b (* c i)))))
   (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -5.5e+122) || !(c <= 1.35e+15)) {
		tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	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 ((c <= (-5.5d+122)) .or. (.not. (c <= 1.35d+15))) then
        tmp = 2.0d0 * ((x * y) - (c * (b * (c * i))))
    else
        tmp = 2.0d0 * ((z * t) + (x * y))
    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 ((c <= -5.5e+122) || !(c <= 1.35e+15)) {
		tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -5.5e+122) or not (c <= 1.35e+15):
		tmp = 2.0 * ((x * y) - (c * (b * (c * i))))
	else:
		tmp = 2.0 * ((z * t) + (x * y))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -5.5e+122) || !(c <= 1.35e+15))
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i)))));
	else
		tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -5.5e+122) || ~((c <= 1.35e+15)))
		tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
	else
		tmp = 2.0 * ((z * t) + (x * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.5e+122], N[Not[LessEqual[c, 1.35e+15]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.5 \cdot 10^{+122} \lor \neg \left(c \leq 1.35 \cdot 10^{+15}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -5.4999999999999998e122 or 1.35e15 < c

    1. Initial program 76.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 87.9%

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    4. Taylor expanded in a around 0 82.6%

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

    if -5.4999999999999998e122 < c < 1.35e15

    1. Initial program 97.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.5 \cdot 10^{+122} \lor \neg \left(c \leq 1.35 \cdot 10^{+15}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 74.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.95 \cdot 10^{+35} \lor \neg \left(c \leq 1.5 \cdot 10^{+15}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -2.95e+35) (not (<= c 1.5e+15)))
   (* -2.0 (* c (* (+ a (* b c)) i)))
   (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -2.95e+35) || !(c <= 1.5e+15)) {
		tmp = -2.0 * (c * ((a + (b * c)) * i));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	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 ((c <= (-2.95d+35)) .or. (.not. (c <= 1.5d+15))) then
        tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
    else
        tmp = 2.0d0 * ((z * t) + (x * y))
    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 ((c <= -2.95e+35) || !(c <= 1.5e+15)) {
		tmp = -2.0 * (c * ((a + (b * c)) * i));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -2.95e+35) or not (c <= 1.5e+15):
		tmp = -2.0 * (c * ((a + (b * c)) * i))
	else:
		tmp = 2.0 * ((z * t) + (x * y))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -2.95e+35) || !(c <= 1.5e+15))
		tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i)));
	else
		tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -2.95e+35) || ~((c <= 1.5e+15)))
		tmp = -2.0 * (c * ((a + (b * c)) * i));
	else
		tmp = 2.0 * ((z * t) + (x * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.95e+35], N[Not[LessEqual[c, 1.5e+15]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.95 \cdot 10^{+35} \lor \neg \left(c \leq 1.5 \cdot 10^{+15}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.94999999999999993e35 or 1.5e15 < c

    1. Initial program 77.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. Step-by-step derivation
      1. associate--l+77.9%

        \[\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)} \]
      2. *-commutative77.9%

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + t \cdot z\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      4. associate--l+77.9%

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

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

        \[\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)} \]
      7. fma-define78.8%

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

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

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

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

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

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

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

    if -2.94999999999999993e35 < c < 1.5e15

    1. Initial program 98.6%

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

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

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

Alternative 11: 40.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot y\right)\\
\mathbf{if}\;y \leq -1.46 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-121}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+72}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.46000000000000005e-40 or 1.35e72 < y

    1. Initial program 88.3%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+88.3%

        \[\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)} \]
      2. *-commutative88.3%

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + t \cdot z\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      4. associate--l+88.3%

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

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

        \[\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)} \]
      7. fma-define89.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative53.8%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. associate-*l*53.8%

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

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot y\right)} \]
    7. Simplified53.8%

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

    if -1.46000000000000005e-40 < y < 2.7000000000000002e-121

    1. Initial program 93.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. Step-by-step derivation
      1. associate--l+93.1%

        \[\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)} \]
      2. *-commutative93.1%

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + t \cdot z\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      4. associate--l+93.1%

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

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

        \[\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)} \]
      7. fma-define93.1%

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

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

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

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

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

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

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

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

    if 2.7000000000000002e-121 < y < 1.35e72

    1. Initial program 87.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.46 \cdot 10^{-40}:\\ \;\;\;\;x \cdot \left(2 \cdot y\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-121}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+72}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(2 \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 69.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.6 \cdot 10^{+131} \lor \neg \left(c \leq 4.2 \cdot 10^{+85}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -2.6e+131) (not (<= c 4.2e+85)))
   (* -2.0 (* c (* (* b c) i)))
   (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -2.6e+131) || !(c <= 4.2e+85)) {
		tmp = -2.0 * (c * ((b * c) * i));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	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 ((c <= (-2.6d+131)) .or. (.not. (c <= 4.2d+85))) then
        tmp = (-2.0d0) * (c * ((b * c) * i))
    else
        tmp = 2.0d0 * ((z * t) + (x * y))
    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 ((c <= -2.6e+131) || !(c <= 4.2e+85)) {
		tmp = -2.0 * (c * ((b * c) * i));
	} else {
		tmp = 2.0 * ((z * t) + (x * y));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -2.6e+131) or not (c <= 4.2e+85):
		tmp = -2.0 * (c * ((b * c) * i))
	else:
		tmp = 2.0 * ((z * t) + (x * y))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -2.6e+131) || !(c <= 4.2e+85))
		tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i)));
	else
		tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -2.6e+131) || ~((c <= 4.2e+85)))
		tmp = -2.0 * (c * ((b * c) * i));
	else
		tmp = 2.0 * ((z * t) + (x * y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.6e+131], N[Not[LessEqual[c, 4.2e+85]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.6 \cdot 10^{+131} \lor \neg \left(c \leq 4.2 \cdot 10^{+85}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.6e131 or 4.2000000000000002e85 < c

    1. Initial program 71.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. Step-by-step derivation
      1. associate--l+71.8%

        \[\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)} \]
      2. *-commutative71.8%

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + t \cdot z\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      4. associate--l+71.8%

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

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

        \[\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)} \]
      7. fma-define73.2%

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

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

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

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

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

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

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

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

    if -2.6e131 < c < 4.2000000000000002e85

    1. Initial program 96.8%

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

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

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

Alternative 13: 39.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-52} \lor \neg \left(y \leq 1.35 \cdot 10^{+72}\right):\\ \;\;\;\;x \cdot \left(2 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -2.2e-52) (not (<= y 1.35e+72)))
   (* x (* 2.0 y))
   (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -2.2e-52) || !(y <= 1.35e+72)) {
		tmp = x * (2.0 * y);
	} else {
		tmp = 2.0 * (z * t);
	}
	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 ((y <= (-2.2d-52)) .or. (.not. (y <= 1.35d+72))) then
        tmp = x * (2.0d0 * y)
    else
        tmp = 2.0d0 * (z * t)
    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 ((y <= -2.2e-52) || !(y <= 1.35e+72)) {
		tmp = x * (2.0 * y);
	} else {
		tmp = 2.0 * (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -2.2e-52) or not (y <= 1.35e+72):
		tmp = x * (2.0 * y)
	else:
		tmp = 2.0 * (z * t)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -2.2e-52) || !(y <= 1.35e+72))
		tmp = Float64(x * Float64(2.0 * y));
	else
		tmp = Float64(2.0 * Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -2.2e-52) || ~((y <= 1.35e+72)))
		tmp = x * (2.0 * y);
	else
		tmp = 2.0 * (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -2.2e-52], N[Not[LessEqual[y, 1.35e+72]], $MachinePrecision]], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-52} \lor \neg \left(y \leq 1.35 \cdot 10^{+72}\right):\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.20000000000000009e-52 or 1.35e72 < y

    1. Initial program 88.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. Step-by-step derivation
      1. associate--l+88.1%

        \[\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)} \]
      2. *-commutative88.1%

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + t \cdot z\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)} \]
      4. associate--l+88.1%

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

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

        \[\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)} \]
      7. fma-define88.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. associate-*l*52.4%

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

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot y\right)} \]
    7. Simplified52.4%

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

    if -2.20000000000000009e-52 < y < 1.35e72

    1. Initial program 91.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 38.9%

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

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

Alternative 14: 29.1% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 89.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 29.4%

    \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  4. Final simplification29.4%

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

Developer Target 1: 94.1% 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 2024135 
(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))))