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

Percentage Accurate: 90.0% → 93.9%
Time: 14.9s
Alternatives: 11
Speedup: 1.0×

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 11 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.0% 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: 93.9% accurate, 1.0× speedup?

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

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 93.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-define93.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*97.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. Simplified97.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-define97.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. +-commutative97.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-rr97.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) \]
  7. Final simplification97.5%

    \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
  8. Add Preprocessing

Alternative 2: 82.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+149} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+69}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000001e149 or 5.00000000000000036e69 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    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. Add Preprocessing
    3. Taylor expanded in z around inf 82.1%

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

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

    if -2.0000000000000001e149 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e69

    1. Initial program 99.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.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) \]
      8. *-commutative99.9%

        \[\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*98.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. +-commutative98.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-define98.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. Simplified98.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 c around 0 91.2%

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

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

Alternative 3: 87.3% accurate, 0.5× speedup?

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

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

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

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


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

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

        \[\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. *-commutative78.2%

        \[\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+78.2%

        \[\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+78.2%

        \[\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. *-commutative78.2%

        \[\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+78.2%

        \[\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.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. *-commutative78.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*90.0%

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

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

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

      \[\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 88.1%

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

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

    1. Initial program 99.9%

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

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

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

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

    1. Initial program 92.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 88.0%

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

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

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

Alternative 4: 92.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 97.3%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing

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

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

        \[\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. *-commutative73.7%

        \[\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+73.7%

        \[\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+73.7%

        \[\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. *-commutative73.7%

        \[\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+73.7%

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

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

        \[\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*86.7%

        \[\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. +-commutative86.7%

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

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

      \[\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 86.9%

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

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

Alternative 5: 48.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.8 \cdot 10^{+102}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

\mathbf{elif}\;c \leq 7.5 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\

\mathbf{elif}\;c \leq 3.1 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -4.79999999999999989e102

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

        \[\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. *-commutative87.2%

        \[\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+87.2%

        \[\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+87.2%

        \[\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. *-commutative87.2%

        \[\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+87.2%

        \[\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-define87.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. *-commutative87.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*97.7%

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

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

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

      \[\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 91.4%

      \[\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 78.6%

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

    if -4.79999999999999989e102 < c < 7.5e-177

    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. Step-by-step derivation
      1. associate--l+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.0%

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

        \[\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*89.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. +-commutative89.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-define89.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. Simplified89.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 x around inf 45.9%

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

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

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

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

    if 7.5e-177 < c < 3.1e73

    1. Initial program 99.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.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) \]
      8. *-commutative99.9%

        \[\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.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. +-commutative97.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-define97.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. Simplified97.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 z around inf 50.5%

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

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot t\right)} \]
      2. *-commutative50.5%

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

        \[\leadsto \color{blue}{\left(t \cdot z\right)} \cdot 2 \]
      4. associate-*r*50.5%

        \[\leadsto \color{blue}{t \cdot \left(z \cdot 2\right)} \]
    7. Simplified50.5%

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

    if 3.1e73 < c

    1. Initial program 82.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+82.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. *-commutative82.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+82.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+82.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. *-commutative82.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+82.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-define82.3%

        \[\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. *-commutative82.3%

        \[\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*90.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. +-commutative90.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-define90.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. Simplified90.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 i around inf 78.4%

      \[\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 62.7%

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

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

        \[\leadsto -2 \cdot \left(c \cdot \left(\color{blue}{\left(c \cdot b\right)} \cdot i\right)\right) \]
      3. associate-*l*62.7%

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

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

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

      \[\leadsto -2 \cdot \left(c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}\right) \]
    10. Step-by-step derivation
      1. associate-*r*62.7%

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

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

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

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

Alternative 6: 48.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq 3.65 \cdot 10^{-180}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\

\mathbf{elif}\;c \leq 2.9 \cdot 10^{+74}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -5.60000000000000037e102 or 2.9000000000000002e74 < c

    1. Initial program 84.6%

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

        \[\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. *-commutative84.6%

        \[\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+84.6%

        \[\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+84.6%

        \[\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. *-commutative84.6%

        \[\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+84.6%

        \[\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-define84.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) \]
      8. *-commutative84.6%

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

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

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

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

      \[\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 84.6%

      \[\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 70.2%

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

    if -5.60000000000000037e102 < c < 3.6499999999999998e-180

    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. Step-by-step derivation
      1. associate--l+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.0%

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

        \[\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*89.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. +-commutative89.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-define89.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. Simplified89.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 x around inf 45.9%

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

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

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

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

    if 3.6499999999999998e-180 < c < 2.9000000000000002e74

    1. Initial program 99.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.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) \]
      8. *-commutative99.9%

        \[\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.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. +-commutative97.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-define97.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. Simplified97.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 z around inf 50.5%

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

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot t\right)} \]
      2. *-commutative50.5%

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

        \[\leadsto \color{blue}{\left(t \cdot z\right)} \cdot 2 \]
      4. associate-*r*50.5%

        \[\leadsto \color{blue}{t \cdot \left(z \cdot 2\right)} \]
    7. Simplified50.5%

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

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

Alternative 7: 37.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(2 \cdot z\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{-263}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{-31}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.0000000000000002e136 or 2.70000000000000014e-31 < z

    1. Initial program 91.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. associate--l+91.6%

        \[\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. *-commutative91.6%

        \[\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+91.6%

        \[\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+91.6%

        \[\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. *-commutative91.6%

        \[\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+91.6%

        \[\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-define91.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) \]
      8. *-commutative91.6%

        \[\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 z around inf 56.4%

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

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot t\right)} \]
      2. *-commutative56.4%

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

        \[\leadsto \color{blue}{\left(t \cdot z\right)} \cdot 2 \]
      4. associate-*r*56.4%

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

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

    if -5.0000000000000002e136 < z < 8.8000000000000001e-263

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

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

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

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

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

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

        \[\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.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. *-commutative93.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*90.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. +-commutative90.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-define90.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. Simplified90.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 x around inf 36.2%

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

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

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

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

    if 8.8000000000000001e-263 < z < 2.70000000000000014e-31

    1. Initial program 99.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.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) \]
      8. *-commutative99.9%

        \[\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*96.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. +-commutative96.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-define96.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. Simplified96.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 a around inf 33.7%

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

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

Alternative 8: 74.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.8 \cdot 10^{+102} \lor \neg \left(c \leq 7.8 \cdot 10^{+59}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.79999999999999989e102 or 7.80000000000000043e59 < c

    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. Step-by-step derivation
      1. associate--l+85.5%

        \[\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. *-commutative85.5%

        \[\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+85.5%

        \[\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+85.5%

        \[\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. *-commutative85.5%

        \[\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+85.5%

        \[\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-define85.5%

        \[\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. *-commutative85.5%

        \[\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*94.1%

        \[\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. +-commutative94.1%

        \[\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-define94.1%

        \[\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. Simplified94.1%

      \[\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 83.5%

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

    if -4.79999999999999989e102 < c < 7.80000000000000043e59

    1. Initial program 99.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+99.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. *-commutative99.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+99.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+99.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. *-commutative99.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+99.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-define99.3%

        \[\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. *-commutative99.3%

        \[\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 c around 0 76.5%

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

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

Alternative 9: 69.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{+104}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.5000000000000002e104

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

        \[\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. *-commutative87.2%

        \[\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+87.2%

        \[\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+87.2%

        \[\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. *-commutative87.2%

        \[\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+87.2%

        \[\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-define87.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. *-commutative87.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*97.7%

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

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

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

      \[\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 91.4%

      \[\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 78.6%

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

    if -3.5000000000000002e104 < c < 2e103

    1. Initial program 98.7%

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

        \[\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. *-commutative98.7%

        \[\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+98.7%

        \[\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+98.7%

        \[\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. *-commutative98.7%

        \[\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+98.7%

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

        \[\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. *-commutative98.7%

        \[\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.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. +-commutative92.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-define92.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. Simplified92.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 c around 0 74.2%

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

    if 2e103 < c

    1. Initial program 82.2%

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

        \[\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. *-commutative82.2%

        \[\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+82.2%

        \[\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+82.2%

        \[\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. *-commutative82.2%

        \[\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+82.2%

        \[\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-define82.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. *-commutative82.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*88.8%

        \[\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. +-commutative88.8%

        \[\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-define88.8%

        \[\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. Simplified88.8%

      \[\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 80.0%

      \[\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 66.6%

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

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

        \[\leadsto -2 \cdot \left(c \cdot \left(\color{blue}{\left(c \cdot b\right)} \cdot i\right)\right) \]
      3. associate-*l*66.5%

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

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

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

      \[\leadsto -2 \cdot \left(c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}\right) \]
    10. Step-by-step derivation
      1. associate-*r*66.6%

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

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

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

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

Alternative 10: 37.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-159} \lor \neg \left(t \leq 2.75 \cdot 10^{+54}\right):\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6500000000000001e-159 or 2.75000000000000013e54 < t

    1. Initial program 92.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+92.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. *-commutative92.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+92.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+92.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. *-commutative92.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+92.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-define92.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. *-commutative92.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.1%

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

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

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

      \[\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 z around inf 45.5%

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

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot t\right)} \]
      2. *-commutative45.5%

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

        \[\leadsto \color{blue}{\left(t \cdot z\right)} \cdot 2 \]
      4. associate-*r*45.5%

        \[\leadsto \color{blue}{t \cdot \left(z \cdot 2\right)} \]
    7. Simplified45.5%

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

    if -1.6500000000000001e-159 < t < 2.75000000000000013e54

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

        \[\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. *-commutative95.2%

        \[\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+95.2%

        \[\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+95.2%

        \[\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. *-commutative95.2%

        \[\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+95.2%

        \[\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-define95.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. *-commutative95.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*93.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. +-commutative93.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-define93.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. Simplified93.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 x around inf 40.8%

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

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

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

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

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

Alternative 11: 28.4% accurate, 3.8× speedup?

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

\\
t \cdot \left(2 \cdot z\right)
\end{array}
Derivation
  1. Initial program 93.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+93.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. *-commutative93.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+93.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+93.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. *-commutative93.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+93.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-define93.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) \]
    8. *-commutative93.9%

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

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

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

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

    \[\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 z around inf 30.3%

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

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

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

      \[\leadsto \color{blue}{\left(t \cdot z\right)} \cdot 2 \]
    4. associate-*r*30.3%

      \[\leadsto \color{blue}{t \cdot \left(z \cdot 2\right)} \]
  7. Simplified30.3%

    \[\leadsto \color{blue}{t \cdot \left(z \cdot 2\right)} \]
  8. Final simplification30.3%

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

Developer Target 1: 93.9% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024145 
(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))))