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

Percentage Accurate: 90.0% → 95.3%
Time: 17.5s
Alternatives: 16
Speedup: 0.5×

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 16 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: 95.3% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 95.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. fma-define95.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) \]
      2. associate-*l*98.9%

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

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

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

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.1% accurate, 0.1× speedup?

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

\\
2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \mathsf{fma}\left(b, c, a\right) \cdot \left(c \cdot \left(-i\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 89.0%

    \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate--l+89.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. *-commutative89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.7% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 92.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. fma-define92.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) \]
      2. associate-*l*98.8%

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 4: 94.7% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_3\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 76.0%

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

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - 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) < 1.00000000000000003e282

    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

    if 1.00000000000000003e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 69.4%

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

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

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

Alternative 5: 73.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;c \leq -8 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;c \leq 1.2 \cdot 10^{+29}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\

\mathbf{elif}\;c \leq 1.6 \cdot 10^{+140}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -8.4999999999999994e222 or 1.2e29 < c < 1.60000000000000005e140

    1. Initial program 84.6%

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

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

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

    if -8.4999999999999994e222 < c < -7.99999999999999957e183 or 1.60000000000000005e140 < c

    1. Initial program 70.4%

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

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

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

    if -7.99999999999999957e183 < c < -1.4499999999999999e45

    1. Initial program 79.4%

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

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

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

    if -1.4499999999999999e45 < c < 6.99999999999999973e-81

    1. Initial program 99.0%

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

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

    if 6.99999999999999973e-81 < c < 1.2e29

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      2. *-commutative82.4%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(i \cdot c\right)} \cdot a\right) \]
      3. associate-*l*82.3%

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

        \[\leadsto 2 \cdot \left(x \cdot y - i \cdot \color{blue}{\left(a \cdot c\right)}\right) \]
    8. Simplified82.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{+222}:\\ \;\;\;\;2 \cdot \left(y \cdot x - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -8 \cdot 10^{+183}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\ \mathbf{elif}\;c \leq -1.45 \cdot 10^{+45}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 7 \cdot 10^{-81}:\\ \;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.2 \cdot 10^{+29}:\\ \;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{elif}\;c \leq 1.6 \cdot 10^{+140}:\\ \;\;\;\;2 \cdot \left(y \cdot x - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 95.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 92.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. fma-define92.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) \]
      2. associate-*l*98.8%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 7: 73.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.6 \cdot 10^{+56} \lor \neg \left(c \leq 5.2 \cdot 10^{-80} \lor \neg \left(c \leq 7.8 \cdot 10^{-7}\right) \land c \leq 3.8 \cdot 10^{+19}\right):\\
\;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -8.6000000000000007e56 or 5.2000000000000002e-80 < c < 7.80000000000000049e-7 or 3.8e19 < c

    1. Initial program 78.8%

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

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

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

    if -8.6000000000000007e56 < c < 5.2000000000000002e-80 or 7.80000000000000049e-7 < c < 3.8e19

    1. Initial program 99.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.6 \cdot 10^{+56} \lor \neg \left(c \leq 5.2 \cdot 10^{-80} \lor \neg \left(c \leq 7.8 \cdot 10^{-7}\right) \land c \leq 3.8 \cdot 10^{+19}\right):\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 79.1% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;c \leq 9.2 \cdot 10^{+18}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.49999999999999991e-48 or 9.2e18 < c

    1. Initial program 78.9%

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

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

    if -3.49999999999999991e-48 < c < 2.8999999999999999e-87

    1. Initial program 99.9%

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

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

    if 2.8999999999999999e-87 < c < 9.2e18

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - a \cdot \left(c \cdot i\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutative80.3%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      2. *-commutative80.3%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(i \cdot c\right)} \cdot a\right) \]
      3. associate-*l*80.2%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{i \cdot \left(c \cdot a\right)}\right) \]
      4. *-commutative80.2%

        \[\leadsto 2 \cdot \left(x \cdot y - i \cdot \color{blue}{\left(a \cdot c\right)}\right) \]
    8. Simplified80.2%

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

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

Alternative 9: 80.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;c \leq 2.3 \cdot 10^{+128}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.80000000000000002e-48 or 2.29999999999999998e128 < c

    1. Initial program 76.6%

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

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

    if -3.80000000000000002e-48 < c < 4.9999999999999998e-82

    1. Initial program 99.9%

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

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

    if 4.9999999999999998e-82 < c < 2.29999999999999998e128

    1. Initial program 97.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 0 86.2%

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

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

Alternative 10: 74.9% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;c \leq 8.5 \cdot 10^{+19}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.94999999999999984e57 or 8.5e19 < c

    1. Initial program 76.7%

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

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

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

    if -1.94999999999999984e57 < c < 4.10000000000000005e-84

    1. Initial program 99.1%

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

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

    if 4.10000000000000005e-84 < c < 8.5e19

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - a \cdot \left(c \cdot i\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutative80.3%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      2. *-commutative80.3%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(i \cdot c\right)} \cdot a\right) \]
      3. associate-*l*80.2%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{i \cdot \left(c \cdot a\right)}\right) \]
      4. *-commutative80.2%

        \[\leadsto 2 \cdot \left(x \cdot y - i \cdot \color{blue}{\left(a \cdot c\right)}\right) \]
    8. Simplified80.2%

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

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

Alternative 11: 73.9% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;c \leq 3.2 \cdot 10^{+19}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\

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


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

    1. Initial program 76.2%

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

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

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

    if -3.7999999999999998e42 < c < 5.4000000000000004e-80

    1. Initial program 99.0%

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

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

    if 5.4000000000000004e-80 < c < 3.2e19

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - a \cdot \left(c \cdot i\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutative80.3%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      2. *-commutative80.3%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(i \cdot c\right)} \cdot a\right) \]
      3. associate-*l*80.2%

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{i \cdot \left(c \cdot a\right)}\right) \]
      4. *-commutative80.2%

        \[\leadsto 2 \cdot \left(x \cdot y - i \cdot \color{blue}{\left(a \cdot c\right)}\right) \]
    8. Simplified80.2%

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

    if 3.2e19 < c

    1. Initial program 78.6%

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

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

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

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

Alternative 12: 87.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.65 \cdot 10^{+42} \lor \neg \left(c \leq 9 \cdot 10^{+19}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.6499999999999999e42 or 9e19 < c

    1. Initial program 77.4%

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

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

    if -1.6499999999999999e42 < c < 9e19

    1. Initial program 99.1%

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

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

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

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

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

Alternative 13: 36.1% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.8000000000000004e130 or 1.06000000000000002e-175 < z

    1. Initial program 89.4%

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

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

    if -7.8000000000000004e130 < z < -1.22000000000000007e-45

    1. Initial program 85.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 29.3%

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

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

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

        \[\leadsto 2 \cdot \left(-\color{blue}{c \cdot \left(i \cdot a\right)}\right) \]
      4. *-commutative25.8%

        \[\leadsto 2 \cdot \left(-c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
      5. distribute-rgt-neg-in25.8%

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

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

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

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

    if -1.22000000000000007e-45 < z < 1.06000000000000002e-175

    1. Initial program 90.6%

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

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

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

Alternative 14: 36.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+107} \lor \neg \left(z \leq 1.06 \cdot 10^{-175}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e107 or 1.06000000000000002e-175 < z

    1. Initial program 88.4%

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

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

    if -1.2e107 < z < 1.06000000000000002e-175

    1. Initial program 89.6%

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

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

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

Alternative 15: 56.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.4 \cdot 10^{+205}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -2.39999999999999986e205

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg71.4%

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

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

        \[\leadsto 2 \cdot \left(-\color{blue}{c \cdot \left(i \cdot a\right)}\right) \]
      4. *-commutative43.3%

        \[\leadsto 2 \cdot \left(-c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
      5. distribute-rgt-neg-in43.3%

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

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

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

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

    if -2.39999999999999986e205 < i

    1. Initial program 88.5%

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

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

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

Alternative 16: 30.0% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 89.0%

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

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

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

Developer target: 94.1% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024039 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))