Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2

Percentage Accurate: 95.1% → 98.6%
Time: 16.6s
Alternatives: 24
Speedup: 0.5×

Specification

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

\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\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 24 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: 95.1% accurate, 1.0× speedup?

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

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

Alternative 1: 98.6% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]

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

    1. Initial program 0.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 23.1%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    3. Step-by-step derivation
      1. mul-1-neg23.1%

        \[\leadsto \color{blue}{\left(-y \cdot z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. distribute-rgt-neg-in23.1%

        \[\leadsto \color{blue}{y \cdot \left(-z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    4. Simplified23.1%

      \[\leadsto \color{blue}{y \cdot \left(-z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    5. Taylor expanded in y around 0 46.2%

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

        \[\leadsto \color{blue}{y \cdot \left(-1 \cdot z + b\right)} + \left(t - 2\right) \cdot b \]
      2. sub-neg46.2%

        \[\leadsto y \cdot \left(-1 \cdot z + b\right) + \color{blue}{\left(t + \left(-2\right)\right)} \cdot b \]
      3. metadata-eval46.2%

        \[\leadsto y \cdot \left(-1 \cdot z + b\right) + \left(t + \color{blue}{-2}\right) \cdot b \]
      4. *-commutative46.2%

        \[\leadsto y \cdot \left(-1 \cdot z + b\right) + \color{blue}{b \cdot \left(t + -2\right)} \]
      5. fma-def61.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, -1 \cdot z + b, b \cdot \left(t + -2\right)\right)} \]
      6. +-commutative61.5%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{b + -1 \cdot z}, b \cdot \left(t + -2\right)\right) \]
      7. mul-1-neg61.5%

        \[\leadsto \mathsf{fma}\left(y, b + \color{blue}{\left(-z\right)}, b \cdot \left(t + -2\right)\right) \]
      8. unsub-neg61.5%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{b - z}, b \cdot \left(t + -2\right)\right) \]
    7. Simplified61.5%

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

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

Alternative 2: 97.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t + \left(y - 2\right), b, x - \mathsf{fma}\left(y + \color{blue}{-1}, z, -\left(-\left(t - 1\right) \cdot a\right)\right)\right) \]
    10. distribute-lft-neg-in97.6%

      \[\leadsto \mathsf{fma}\left(t + \left(y - 2\right), b, x - \mathsf{fma}\left(y + -1, z, -\color{blue}{\left(-\left(t - 1\right)\right) \cdot a}\right)\right) \]
    11. distribute-lft-neg-in97.6%

      \[\leadsto \mathsf{fma}\left(t + \left(y - 2\right), b, x - \mathsf{fma}\left(y + -1, z, \color{blue}{\left(-\left(-\left(t - 1\right)\right)\right) \cdot a}\right)\right) \]
    12. remove-double-neg97.6%

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(t + \left(y - 2\right), b, x - \mathsf{fma}\left(y + -1, z, \left(t + -1\right) \cdot a\right)\right)} \]
  4. Final simplification97.6%

    \[\leadsto \mathsf{fma}\left(t + \left(y - 2\right), b, x - \mathsf{fma}\left(y - 1, z, a \cdot \left(t + -1\right)\right)\right) \]

Alternative 3: 98.1% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;y \cdot \left(b - z\right)\\


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

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]

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

    1. Initial program 0.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 54.3%

      \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

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

Alternative 4: 64.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(z - y \cdot z\right)\\ t_2 := x + b \cdot \left(\left(t + y\right) - 2\right)\\ t_3 := x + \left(a - t \cdot a\right)\\ \mathbf{if}\;b \leq -1.2 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -9.2 \cdot 10^{-265}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 10^{-256}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-212}:\\ \;\;\;\;\left(z + a\right) - y \cdot z\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-70}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.56 \cdot 10^{+44}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (- z (* y z))))
        (t_2 (+ x (* b (- (+ t y) 2.0))))
        (t_3 (+ x (- a (* t a)))))
   (if (<= b -1.2e+32)
     t_2
     (if (<= b -9.2e-265)
       t_1
       (if (<= b 1e-256)
         t_3
         (if (<= b 9.5e-212)
           (- (+ z a) (* y z))
           (if (<= b 6e-70) t_3 (if (<= b 1.56e+44) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z - (y * z));
	double t_2 = x + (b * ((t + y) - 2.0));
	double t_3 = x + (a - (t * a));
	double tmp;
	if (b <= -1.2e+32) {
		tmp = t_2;
	} else if (b <= -9.2e-265) {
		tmp = t_1;
	} else if (b <= 1e-256) {
		tmp = t_3;
	} else if (b <= 9.5e-212) {
		tmp = (z + a) - (y * z);
	} else if (b <= 6e-70) {
		tmp = t_3;
	} else if (b <= 1.56e+44) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (z - (y * z))
    t_2 = x + (b * ((t + y) - 2.0d0))
    t_3 = x + (a - (t * a))
    if (b <= (-1.2d+32)) then
        tmp = t_2
    else if (b <= (-9.2d-265)) then
        tmp = t_1
    else if (b <= 1d-256) then
        tmp = t_3
    else if (b <= 9.5d-212) then
        tmp = (z + a) - (y * z)
    else if (b <= 6d-70) then
        tmp = t_3
    else if (b <= 1.56d+44) then
        tmp = 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 t_1 = x + (z - (y * z));
	double t_2 = x + (b * ((t + y) - 2.0));
	double t_3 = x + (a - (t * a));
	double tmp;
	if (b <= -1.2e+32) {
		tmp = t_2;
	} else if (b <= -9.2e-265) {
		tmp = t_1;
	} else if (b <= 1e-256) {
		tmp = t_3;
	} else if (b <= 9.5e-212) {
		tmp = (z + a) - (y * z);
	} else if (b <= 6e-70) {
		tmp = t_3;
	} else if (b <= 1.56e+44) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (z - (y * z))
	t_2 = x + (b * ((t + y) - 2.0))
	t_3 = x + (a - (t * a))
	tmp = 0
	if b <= -1.2e+32:
		tmp = t_2
	elif b <= -9.2e-265:
		tmp = t_1
	elif b <= 1e-256:
		tmp = t_3
	elif b <= 9.5e-212:
		tmp = (z + a) - (y * z)
	elif b <= 6e-70:
		tmp = t_3
	elif b <= 1.56e+44:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(z - Float64(y * z)))
	t_2 = Float64(x + Float64(b * Float64(Float64(t + y) - 2.0)))
	t_3 = Float64(x + Float64(a - Float64(t * a)))
	tmp = 0.0
	if (b <= -1.2e+32)
		tmp = t_2;
	elseif (b <= -9.2e-265)
		tmp = t_1;
	elseif (b <= 1e-256)
		tmp = t_3;
	elseif (b <= 9.5e-212)
		tmp = Float64(Float64(z + a) - Float64(y * z));
	elseif (b <= 6e-70)
		tmp = t_3;
	elseif (b <= 1.56e+44)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (z - (y * z));
	t_2 = x + (b * ((t + y) - 2.0));
	t_3 = x + (a - (t * a));
	tmp = 0.0;
	if (b <= -1.2e+32)
		tmp = t_2;
	elseif (b <= -9.2e-265)
		tmp = t_1;
	elseif (b <= 1e-256)
		tmp = t_3;
	elseif (b <= 9.5e-212)
		tmp = (z + a) - (y * z);
	elseif (b <= 6e-70)
		tmp = t_3;
	elseif (b <= 1.56e+44)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(a - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.2e+32], t$95$2, If[LessEqual[b, -9.2e-265], t$95$1, If[LessEqual[b, 1e-256], t$95$3, If[LessEqual[b, 9.5e-212], N[(N[(z + a), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-70], t$95$3, If[LessEqual[b, 1.56e+44], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(z - y \cdot z\right)\\
t_2 := x + b \cdot \left(\left(t + y\right) - 2\right)\\
t_3 := x + \left(a - t \cdot a\right)\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+32}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -9.2 \cdot 10^{-265}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 10^{-256}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq 9.5 \cdot 10^{-212}:\\
\;\;\;\;\left(z + a\right) - y \cdot z\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-70}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq 1.56 \cdot 10^{+44}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.19999999999999996e32 or 1.56e44 < b

    1. Initial program 89.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around 0 85.2%

      \[\leadsto \color{blue}{\left(\left(\left(y + t\right) - 2\right) \cdot b + x\right) - z \cdot \left(y - 1\right)} \]
    3. Taylor expanded in z around 0 83.0%

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

    if -1.19999999999999996e32 < b < -9.1999999999999996e-265 or 6.0000000000000003e-70 < b < 1.56e44

    1. Initial program 99.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 89.9%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 64.4%

      \[\leadsto x - \color{blue}{z \cdot \left(y - 1\right)} \]
    4. Step-by-step derivation
      1. sub-neg64.4%

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval64.4%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in64.4%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-164.4%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg64.4%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative64.4%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified64.4%

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

    if -9.1999999999999996e-265 < b < 9.99999999999999977e-257 or 9.50000000000000029e-212 < b < 6.0000000000000003e-70

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 87.3%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around inf 67.7%

      \[\leadsto x - \color{blue}{\left(t - 1\right) \cdot a} \]
    4. Step-by-step derivation
      1. sub-neg67.7%

        \[\leadsto x - \color{blue}{\left(t + \left(-1\right)\right)} \cdot a \]
      2. metadata-eval67.7%

        \[\leadsto x - \left(t + \color{blue}{-1}\right) \cdot a \]
      3. *-commutative67.7%

        \[\leadsto x - \color{blue}{a \cdot \left(t + -1\right)} \]
      4. distribute-rgt-in67.7%

        \[\leadsto x - \color{blue}{\left(t \cdot a + -1 \cdot a\right)} \]
      5. neg-mul-167.7%

        \[\leadsto x - \left(t \cdot a + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg67.7%

        \[\leadsto x - \color{blue}{\left(t \cdot a - a\right)} \]
      7. *-commutative67.7%

        \[\leadsto x - \left(\color{blue}{a \cdot t} - a\right) \]
    5. Simplified67.7%

      \[\leadsto x - \color{blue}{\left(a \cdot t - a\right)} \]

    if 9.99999999999999977e-257 < b < 9.50000000000000029e-212

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 100.0%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 83.9%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def84.0%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg84.0%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval84.0%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def83.9%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-183.9%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg83.9%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in83.9%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-183.9%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg83.9%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative83.9%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified83.9%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in x around 0 75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{+32}:\\ \;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{elif}\;b \leq -9.2 \cdot 10^{-265}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{elif}\;b \leq 10^{-256}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-212}:\\ \;\;\;\;\left(z + a\right) - y \cdot z\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-70}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \mathbf{elif}\;b \leq 1.56 \cdot 10^{+44}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\ \end{array} \]

Alternative 5: 61.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(z - y \cdot z\right)\\ t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\ t_3 := x + \left(a - t \cdot a\right)\\ \mathbf{if}\;b \leq -1.05 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -3.6 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.35 \cdot 10^{-282}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-211}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-70}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{+110}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (- z (* y z))))
        (t_2 (* b (- (+ t y) 2.0)))
        (t_3 (+ x (- a (* t a)))))
   (if (<= b -1.05e+32)
     t_2
     (if (<= b -3.6e-264)
       t_1
       (if (<= b 2.35e-282)
         t_3
         (if (<= b 2.1e-211)
           t_1
           (if (<= b 6e-70) t_3 (if (<= b 1.05e+110) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z - (y * z));
	double t_2 = b * ((t + y) - 2.0);
	double t_3 = x + (a - (t * a));
	double tmp;
	if (b <= -1.05e+32) {
		tmp = t_2;
	} else if (b <= -3.6e-264) {
		tmp = t_1;
	} else if (b <= 2.35e-282) {
		tmp = t_3;
	} else if (b <= 2.1e-211) {
		tmp = t_1;
	} else if (b <= 6e-70) {
		tmp = t_3;
	} else if (b <= 1.05e+110) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (z - (y * z))
    t_2 = b * ((t + y) - 2.0d0)
    t_3 = x + (a - (t * a))
    if (b <= (-1.05d+32)) then
        tmp = t_2
    else if (b <= (-3.6d-264)) then
        tmp = t_1
    else if (b <= 2.35d-282) then
        tmp = t_3
    else if (b <= 2.1d-211) then
        tmp = t_1
    else if (b <= 6d-70) then
        tmp = t_3
    else if (b <= 1.05d+110) then
        tmp = 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 t_1 = x + (z - (y * z));
	double t_2 = b * ((t + y) - 2.0);
	double t_3 = x + (a - (t * a));
	double tmp;
	if (b <= -1.05e+32) {
		tmp = t_2;
	} else if (b <= -3.6e-264) {
		tmp = t_1;
	} else if (b <= 2.35e-282) {
		tmp = t_3;
	} else if (b <= 2.1e-211) {
		tmp = t_1;
	} else if (b <= 6e-70) {
		tmp = t_3;
	} else if (b <= 1.05e+110) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (z - (y * z))
	t_2 = b * ((t + y) - 2.0)
	t_3 = x + (a - (t * a))
	tmp = 0
	if b <= -1.05e+32:
		tmp = t_2
	elif b <= -3.6e-264:
		tmp = t_1
	elif b <= 2.35e-282:
		tmp = t_3
	elif b <= 2.1e-211:
		tmp = t_1
	elif b <= 6e-70:
		tmp = t_3
	elif b <= 1.05e+110:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(z - Float64(y * z)))
	t_2 = Float64(b * Float64(Float64(t + y) - 2.0))
	t_3 = Float64(x + Float64(a - Float64(t * a)))
	tmp = 0.0
	if (b <= -1.05e+32)
		tmp = t_2;
	elseif (b <= -3.6e-264)
		tmp = t_1;
	elseif (b <= 2.35e-282)
		tmp = t_3;
	elseif (b <= 2.1e-211)
		tmp = t_1;
	elseif (b <= 6e-70)
		tmp = t_3;
	elseif (b <= 1.05e+110)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (z - (y * z));
	t_2 = b * ((t + y) - 2.0);
	t_3 = x + (a - (t * a));
	tmp = 0.0;
	if (b <= -1.05e+32)
		tmp = t_2;
	elseif (b <= -3.6e-264)
		tmp = t_1;
	elseif (b <= 2.35e-282)
		tmp = t_3;
	elseif (b <= 2.1e-211)
		tmp = t_1;
	elseif (b <= 6e-70)
		tmp = t_3;
	elseif (b <= 1.05e+110)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(a - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.05e+32], t$95$2, If[LessEqual[b, -3.6e-264], t$95$1, If[LessEqual[b, 2.35e-282], t$95$3, If[LessEqual[b, 2.1e-211], t$95$1, If[LessEqual[b, 6e-70], t$95$3, If[LessEqual[b, 1.05e+110], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(z - y \cdot z\right)\\
t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\
t_3 := x + \left(a - t \cdot a\right)\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{+32}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -3.6 \cdot 10^{-264}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 2.35 \cdot 10^{-282}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq 2.1 \cdot 10^{-211}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-70}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq 1.05 \cdot 10^{+110}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.05e32 or 1.05000000000000007e110 < b

    1. Initial program 89.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 82.4%

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

    if -1.05e32 < b < -3.6000000000000002e-264 or 2.35e-282 < b < 2.10000000000000008e-211 or 6.0000000000000003e-70 < b < 1.05000000000000007e110

    1. Initial program 97.5%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 88.2%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 63.8%

      \[\leadsto x - \color{blue}{z \cdot \left(y - 1\right)} \]
    4. Step-by-step derivation
      1. sub-neg63.8%

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval63.8%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in63.8%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-163.8%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg63.8%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative63.8%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified63.8%

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

    if -3.6000000000000002e-264 < b < 2.35e-282 or 2.10000000000000008e-211 < b < 6.0000000000000003e-70

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 87.0%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around inf 66.8%

      \[\leadsto x - \color{blue}{\left(t - 1\right) \cdot a} \]
    4. Step-by-step derivation
      1. sub-neg66.8%

        \[\leadsto x - \color{blue}{\left(t + \left(-1\right)\right)} \cdot a \]
      2. metadata-eval66.8%

        \[\leadsto x - \left(t + \color{blue}{-1}\right) \cdot a \]
      3. *-commutative66.8%

        \[\leadsto x - \color{blue}{a \cdot \left(t + -1\right)} \]
      4. distribute-rgt-in66.8%

        \[\leadsto x - \color{blue}{\left(t \cdot a + -1 \cdot a\right)} \]
      5. neg-mul-166.8%

        \[\leadsto x - \left(t \cdot a + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg66.8%

        \[\leadsto x - \color{blue}{\left(t \cdot a - a\right)} \]
      7. *-commutative66.8%

        \[\leadsto x - \left(\color{blue}{a \cdot t} - a\right) \]
    5. Simplified66.8%

      \[\leadsto x - \color{blue}{\left(a \cdot t - a\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{+32}:\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{elif}\;b \leq -3.6 \cdot 10^{-264}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{elif}\;b \leq 2.35 \cdot 10^{-282}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-211}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-70}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{+110}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \end{array} \]

Alternative 6: 61.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(z - y \cdot z\right)\\ t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\ t_3 := x + \left(a - t \cdot a\right)\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-266}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-211}:\\ \;\;\;\;\left(z + a\right) - y \cdot z\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-67}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 9.6 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (- z (* y z))))
        (t_2 (* b (- (+ t y) 2.0)))
        (t_3 (+ x (- a (* t a)))))
   (if (<= b -1.3e+32)
     t_2
     (if (<= b -1.1e-264)
       t_1
       (if (<= b 1.8e-266)
         t_3
         (if (<= b 1.25e-211)
           (- (+ z a) (* y z))
           (if (<= b 2.6e-67) t_3 (if (<= b 9.6e+109) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z - (y * z));
	double t_2 = b * ((t + y) - 2.0);
	double t_3 = x + (a - (t * a));
	double tmp;
	if (b <= -1.3e+32) {
		tmp = t_2;
	} else if (b <= -1.1e-264) {
		tmp = t_1;
	} else if (b <= 1.8e-266) {
		tmp = t_3;
	} else if (b <= 1.25e-211) {
		tmp = (z + a) - (y * z);
	} else if (b <= 2.6e-67) {
		tmp = t_3;
	} else if (b <= 9.6e+109) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (z - (y * z))
    t_2 = b * ((t + y) - 2.0d0)
    t_3 = x + (a - (t * a))
    if (b <= (-1.3d+32)) then
        tmp = t_2
    else if (b <= (-1.1d-264)) then
        tmp = t_1
    else if (b <= 1.8d-266) then
        tmp = t_3
    else if (b <= 1.25d-211) then
        tmp = (z + a) - (y * z)
    else if (b <= 2.6d-67) then
        tmp = t_3
    else if (b <= 9.6d+109) then
        tmp = 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 t_1 = x + (z - (y * z));
	double t_2 = b * ((t + y) - 2.0);
	double t_3 = x + (a - (t * a));
	double tmp;
	if (b <= -1.3e+32) {
		tmp = t_2;
	} else if (b <= -1.1e-264) {
		tmp = t_1;
	} else if (b <= 1.8e-266) {
		tmp = t_3;
	} else if (b <= 1.25e-211) {
		tmp = (z + a) - (y * z);
	} else if (b <= 2.6e-67) {
		tmp = t_3;
	} else if (b <= 9.6e+109) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (z - (y * z))
	t_2 = b * ((t + y) - 2.0)
	t_3 = x + (a - (t * a))
	tmp = 0
	if b <= -1.3e+32:
		tmp = t_2
	elif b <= -1.1e-264:
		tmp = t_1
	elif b <= 1.8e-266:
		tmp = t_3
	elif b <= 1.25e-211:
		tmp = (z + a) - (y * z)
	elif b <= 2.6e-67:
		tmp = t_3
	elif b <= 9.6e+109:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(z - Float64(y * z)))
	t_2 = Float64(b * Float64(Float64(t + y) - 2.0))
	t_3 = Float64(x + Float64(a - Float64(t * a)))
	tmp = 0.0
	if (b <= -1.3e+32)
		tmp = t_2;
	elseif (b <= -1.1e-264)
		tmp = t_1;
	elseif (b <= 1.8e-266)
		tmp = t_3;
	elseif (b <= 1.25e-211)
		tmp = Float64(Float64(z + a) - Float64(y * z));
	elseif (b <= 2.6e-67)
		tmp = t_3;
	elseif (b <= 9.6e+109)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (z - (y * z));
	t_2 = b * ((t + y) - 2.0);
	t_3 = x + (a - (t * a));
	tmp = 0.0;
	if (b <= -1.3e+32)
		tmp = t_2;
	elseif (b <= -1.1e-264)
		tmp = t_1;
	elseif (b <= 1.8e-266)
		tmp = t_3;
	elseif (b <= 1.25e-211)
		tmp = (z + a) - (y * z);
	elseif (b <= 2.6e-67)
		tmp = t_3;
	elseif (b <= 9.6e+109)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(a - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e+32], t$95$2, If[LessEqual[b, -1.1e-264], t$95$1, If[LessEqual[b, 1.8e-266], t$95$3, If[LessEqual[b, 1.25e-211], N[(N[(z + a), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e-67], t$95$3, If[LessEqual[b, 9.6e+109], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(z - y \cdot z\right)\\
t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\
t_3 := x + \left(a - t \cdot a\right)\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{+32}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -1.1 \cdot 10^{-264}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.8 \cdot 10^{-266}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-211}:\\
\;\;\;\;\left(z + a\right) - y \cdot z\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-67}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq 9.6 \cdot 10^{+109}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.3000000000000001e32 or 9.59999999999999949e109 < b

    1. Initial program 89.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 82.4%

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

    if -1.3000000000000001e32 < b < -1.09999999999999997e-264 or 2.5999999999999999e-67 < b < 9.59999999999999949e109

    1. Initial program 97.2%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 86.7%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 62.7%

      \[\leadsto x - \color{blue}{z \cdot \left(y - 1\right)} \]
    4. Step-by-step derivation
      1. sub-neg62.7%

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval62.7%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in62.7%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-162.7%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg62.7%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative62.7%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified62.7%

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

    if -1.09999999999999997e-264 < b < 1.8e-266 or 1.2500000000000001e-211 < b < 2.5999999999999999e-67

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 87.3%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around inf 67.7%

      \[\leadsto x - \color{blue}{\left(t - 1\right) \cdot a} \]
    4. Step-by-step derivation
      1. sub-neg67.7%

        \[\leadsto x - \color{blue}{\left(t + \left(-1\right)\right)} \cdot a \]
      2. metadata-eval67.7%

        \[\leadsto x - \left(t + \color{blue}{-1}\right) \cdot a \]
      3. *-commutative67.7%

        \[\leadsto x - \color{blue}{a \cdot \left(t + -1\right)} \]
      4. distribute-rgt-in67.7%

        \[\leadsto x - \color{blue}{\left(t \cdot a + -1 \cdot a\right)} \]
      5. neg-mul-167.7%

        \[\leadsto x - \left(t \cdot a + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg67.7%

        \[\leadsto x - \color{blue}{\left(t \cdot a - a\right)} \]
      7. *-commutative67.7%

        \[\leadsto x - \left(\color{blue}{a \cdot t} - a\right) \]
    5. Simplified67.7%

      \[\leadsto x - \color{blue}{\left(a \cdot t - a\right)} \]

    if 1.8e-266 < b < 1.2500000000000001e-211

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 100.0%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 83.9%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def84.0%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg84.0%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval84.0%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def83.9%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-183.9%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg83.9%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in83.9%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-183.9%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg83.9%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative83.9%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified83.9%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in x around 0 75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{+32}:\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-264}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-266}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-211}:\\ \;\;\;\;\left(z + a\right) - y \cdot z\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-67}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \mathbf{elif}\;b \leq 9.6 \cdot 10^{+109}:\\ \;\;\;\;x + \left(z - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \end{array} \]

Alternative 7: 84.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+165} \lor \neg \left(a \leq 1.15 \cdot 10^{+99}\right):\\
\;\;\;\;x + \left(a \cdot \left(1 - t\right) - z \cdot \left(y - 1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.99999999999999991e165 or 1.1500000000000001e99 < a

    1. Initial program 89.7%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 88.0%

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

    if -6.99999999999999991e165 < a < 1.1500000000000001e99

    1. Initial program 97.2%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around 0 89.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+165} \lor \neg \left(a \leq 1.15 \cdot 10^{+99}\right):\\ \;\;\;\;x + \left(a \cdot \left(1 - t\right) - z \cdot \left(y - 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) + z \cdot \left(1 - y\right)\\ \end{array} \]

Alternative 8: 50.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(b - z\right)\\ t_2 := b \cdot \left(t - 2\right)\\ \mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-207}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-267}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-141}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 3.5:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (- b z))) (t_2 (* b (- t 2.0))))
   (if (<= y -7.5e+36)
     t_1
     (if (<= y -6e-126)
       (* t (- b a))
       (if (<= y -4.2e-207)
         (+ x z)
         (if (<= y -1.15e-267)
           t_2
           (if (<= y 4.6e-141) (+ x z) (if (<= y 3.5) t_2 t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (b - z);
	double t_2 = b * (t - 2.0);
	double tmp;
	if (y <= -7.5e+36) {
		tmp = t_1;
	} else if (y <= -6e-126) {
		tmp = t * (b - a);
	} else if (y <= -4.2e-207) {
		tmp = x + z;
	} else if (y <= -1.15e-267) {
		tmp = t_2;
	} else if (y <= 4.6e-141) {
		tmp = x + z;
	} else if (y <= 3.5) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (b - z)
    t_2 = b * (t - 2.0d0)
    if (y <= (-7.5d+36)) then
        tmp = t_1
    else if (y <= (-6d-126)) then
        tmp = t * (b - a)
    else if (y <= (-4.2d-207)) then
        tmp = x + z
    else if (y <= (-1.15d-267)) then
        tmp = t_2
    else if (y <= 4.6d-141) then
        tmp = x + z
    else if (y <= 3.5d0) then
        tmp = t_2
    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 t_1 = y * (b - z);
	double t_2 = b * (t - 2.0);
	double tmp;
	if (y <= -7.5e+36) {
		tmp = t_1;
	} else if (y <= -6e-126) {
		tmp = t * (b - a);
	} else if (y <= -4.2e-207) {
		tmp = x + z;
	} else if (y <= -1.15e-267) {
		tmp = t_2;
	} else if (y <= 4.6e-141) {
		tmp = x + z;
	} else if (y <= 3.5) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (b - z)
	t_2 = b * (t - 2.0)
	tmp = 0
	if y <= -7.5e+36:
		tmp = t_1
	elif y <= -6e-126:
		tmp = t * (b - a)
	elif y <= -4.2e-207:
		tmp = x + z
	elif y <= -1.15e-267:
		tmp = t_2
	elif y <= 4.6e-141:
		tmp = x + z
	elif y <= 3.5:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(b - z))
	t_2 = Float64(b * Float64(t - 2.0))
	tmp = 0.0
	if (y <= -7.5e+36)
		tmp = t_1;
	elseif (y <= -6e-126)
		tmp = Float64(t * Float64(b - a));
	elseif (y <= -4.2e-207)
		tmp = Float64(x + z);
	elseif (y <= -1.15e-267)
		tmp = t_2;
	elseif (y <= 4.6e-141)
		tmp = Float64(x + z);
	elseif (y <= 3.5)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (b - z);
	t_2 = b * (t - 2.0);
	tmp = 0.0;
	if (y <= -7.5e+36)
		tmp = t_1;
	elseif (y <= -6e-126)
		tmp = t * (b - a);
	elseif (y <= -4.2e-207)
		tmp = x + z;
	elseif (y <= -1.15e-267)
		tmp = t_2;
	elseif (y <= 4.6e-141)
		tmp = x + z;
	elseif (y <= 3.5)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+36], t$95$1, If[LessEqual[y, -6e-126], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.2e-207], N[(x + z), $MachinePrecision], If[LessEqual[y, -1.15e-267], t$95$2, If[LessEqual[y, 4.6e-141], N[(x + z), $MachinePrecision], If[LessEqual[y, 3.5], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
t_2 := b \cdot \left(t - 2\right)\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -6 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(b - a\right)\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-207}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;y \leq -1.15 \cdot 10^{-267}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 4.6 \cdot 10^{-141}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;y \leq 3.5:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.50000000000000054e36 or 3.5 < y

    1. Initial program 92.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 70.9%

      \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]

    if -7.50000000000000054e36 < y < -6.0000000000000003e-126

    1. Initial program 97.2%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in t around inf 51.1%

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]

    if -6.0000000000000003e-126 < y < -4.20000000000000007e-207 or -1.15000000000000003e-267 < y < 4.5999999999999999e-141

    1. Initial program 98.1%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 71.6%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 51.2%

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

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval51.2%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in51.2%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-151.2%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg51.2%

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

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified51.2%

      \[\leadsto x - \color{blue}{\left(z \cdot y - z\right)} \]
    6. Taylor expanded in y around 0 51.2%

      \[\leadsto \color{blue}{z + x} \]

    if -4.20000000000000007e-207 < y < -1.15000000000000003e-267 or 4.5999999999999999e-141 < y < 3.5

    1. Initial program 97.6%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 51.5%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around 0 51.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+36}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-207}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-267}:\\ \;\;\;\;b \cdot \left(t - 2\right)\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-141}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 3.5:\\ \;\;\;\;b \cdot \left(t - 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \end{array} \]

Alternative 9: 71.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := x + b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -3 \cdot 10^{+31}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.4 \cdot 10^{-98}:\\
\;\;\;\;a \cdot \left(1 - t\right) - z \cdot \left(y - 1\right)\\

\mathbf{elif}\;b \leq 7.5 \cdot 10^{-82} \lor \neg \left(b \leq 1.06 \cdot 10^{+55}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999989e31 or 1.3999999999999999e-98 < b < 7.4999999999999997e-82 or 1.06000000000000004e55 < b

    1. Initial program 89.4%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around 0 86.6%

      \[\leadsto \color{blue}{\left(\left(\left(y + t\right) - 2\right) \cdot b + x\right) - z \cdot \left(y - 1\right)} \]
    3. Taylor expanded in z around 0 84.4%

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

    if -2.99999999999999989e31 < b < 1.3999999999999999e-98

    1. Initial program 99.1%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.1%

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

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

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

        \[\leadsto \left(-\color{blue}{a \cdot \left(t - 1\right)}\right) + \left(\left(x - \left(y - 1\right) \cdot z\right) + \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      5. distribute-rgt-neg-in99.1%

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

        \[\leadsto a \cdot \left(-\left(t - 1\right)\right) + \color{blue}{\left(\left(\left(y + t\right) - 2\right) \cdot b + \left(x - \left(y - 1\right) \cdot z\right)\right)} \]
      7. fma-def100.0%

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{0 - \left(t - 1\right)}, \left(\left(y + t\right) - 2\right) \cdot b + \left(x - \left(y - 1\right) \cdot z\right)\right) \]
      9. associate--r-100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(\color{blue}{y + \left(t + \left(-2\right)\right)}, b, x - \left(y - 1\right) \cdot z\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(y + \left(t + \color{blue}{-2}\right), b, x - \left(y - 1\right) \cdot z\right)\right) \]
      17. sub-neg100.0%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(z, 1 - y, x\right)\right)\right)} \]
    4. Taylor expanded in x around 0 82.3%

      \[\leadsto \mathsf{fma}\left(a, 1 - t, \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b + z \cdot \left(1 - y\right)}\right) \]
    5. Step-by-step derivation
      1. +-commutative82.3%

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \color{blue}{\mathsf{fma}\left(z, 1 - y, \left(\left(y + t\right) - 2\right) \cdot b\right)}\right) \]
      3. sub-neg82.3%

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, \left(\left(y + t\right) + \color{blue}{-2}\right) \cdot b\right)\right) \]
      5. associate-+r+82.3%

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, \color{blue}{\left(y + \left(t + -2\right)\right)} \cdot b\right)\right) \]
      6. *-commutative82.3%

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, \color{blue}{b \cdot \left(y + \left(t + -2\right)\right)}\right)\right) \]
    6. Simplified82.3%

      \[\leadsto \mathsf{fma}\left(a, 1 - t, \color{blue}{\mathsf{fma}\left(z, 1 - y, b \cdot \left(y + \left(t + -2\right)\right)\right)}\right) \]
    7. Taylor expanded in b around 0 75.3%

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

    if 7.4999999999999997e-82 < b < 1.06000000000000004e55

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 87.7%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 75.0%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def75.0%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg75.0%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval75.0%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def75.0%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-175.0%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg75.0%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in75.0%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-175.0%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg75.0%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative75.0%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified75.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{+31}:\\ \;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{-98}:\\ \;\;\;\;a \cdot \left(1 - t\right) - z \cdot \left(y - 1\right)\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-82} \lor \neg \left(b \leq 1.06 \cdot 10^{+55}\right):\\ \;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a + \left(z - y \cdot z\right)\right)\\ \end{array} \]

Alternative 10: 83.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+32} \lor \neg \left(b \leq 5.8 \cdot 10^{+52}\right):\\
\;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.3000000000000001e32 or 5.8e52 < b

    1. Initial program 88.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around 0 85.9%

      \[\leadsto \color{blue}{\left(\left(\left(y + t\right) - 2\right) \cdot b + x\right) - z \cdot \left(y - 1\right)} \]
    3. Taylor expanded in z around 0 83.7%

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

    if -1.3000000000000001e32 < b < 5.8e52

    1. Initial program 99.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 90.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{+32} \lor \neg \left(b \leq 5.8 \cdot 10^{+52}\right):\\ \;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot \left(1 - t\right) - z \cdot \left(y - 1\right)\right)\\ \end{array} \]

Alternative 11: 35.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(t - 2\right)\\ \mathbf{if}\;b \leq -1.26 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.15 \cdot 10^{-147}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;b \leq -3.4 \cdot 10^{-264}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{+65}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{+170}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- t 2.0))))
   (if (<= b -1.26e+32)
     t_1
     (if (<= b -2.15e-147)
       (* z (- y))
       (if (<= b -3.4e-264)
         (+ x z)
         (if (<= b 8.5e+65) (+ x a) (if (<= b 2.15e+170) t_1 (* y b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (t - 2.0);
	double tmp;
	if (b <= -1.26e+32) {
		tmp = t_1;
	} else if (b <= -2.15e-147) {
		tmp = z * -y;
	} else if (b <= -3.4e-264) {
		tmp = x + z;
	} else if (b <= 8.5e+65) {
		tmp = x + a;
	} else if (b <= 2.15e+170) {
		tmp = t_1;
	} else {
		tmp = y * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = b * (t - 2.0d0)
    if (b <= (-1.26d+32)) then
        tmp = t_1
    else if (b <= (-2.15d-147)) then
        tmp = z * -y
    else if (b <= (-3.4d-264)) then
        tmp = x + z
    else if (b <= 8.5d+65) then
        tmp = x + a
    else if (b <= 2.15d+170) then
        tmp = t_1
    else
        tmp = y * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (t - 2.0);
	double tmp;
	if (b <= -1.26e+32) {
		tmp = t_1;
	} else if (b <= -2.15e-147) {
		tmp = z * -y;
	} else if (b <= -3.4e-264) {
		tmp = x + z;
	} else if (b <= 8.5e+65) {
		tmp = x + a;
	} else if (b <= 2.15e+170) {
		tmp = t_1;
	} else {
		tmp = y * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (t - 2.0)
	tmp = 0
	if b <= -1.26e+32:
		tmp = t_1
	elif b <= -2.15e-147:
		tmp = z * -y
	elif b <= -3.4e-264:
		tmp = x + z
	elif b <= 8.5e+65:
		tmp = x + a
	elif b <= 2.15e+170:
		tmp = t_1
	else:
		tmp = y * b
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(t - 2.0))
	tmp = 0.0
	if (b <= -1.26e+32)
		tmp = t_1;
	elseif (b <= -2.15e-147)
		tmp = Float64(z * Float64(-y));
	elseif (b <= -3.4e-264)
		tmp = Float64(x + z);
	elseif (b <= 8.5e+65)
		tmp = Float64(x + a);
	elseif (b <= 2.15e+170)
		tmp = t_1;
	else
		tmp = Float64(y * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (t - 2.0);
	tmp = 0.0;
	if (b <= -1.26e+32)
		tmp = t_1;
	elseif (b <= -2.15e-147)
		tmp = z * -y;
	elseif (b <= -3.4e-264)
		tmp = x + z;
	elseif (b <= 8.5e+65)
		tmp = x + a;
	elseif (b <= 2.15e+170)
		tmp = t_1;
	else
		tmp = y * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.26e+32], t$95$1, If[LessEqual[b, -2.15e-147], N[(z * (-y)), $MachinePrecision], If[LessEqual[b, -3.4e-264], N[(x + z), $MachinePrecision], If[LessEqual[b, 8.5e+65], N[(x + a), $MachinePrecision], If[LessEqual[b, 2.15e+170], t$95$1, N[(y * b), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(t - 2\right)\\
\mathbf{if}\;b \leq -1.26 \cdot 10^{+32}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -2.15 \cdot 10^{-147}:\\
\;\;\;\;z \cdot \left(-y\right)\\

\mathbf{elif}\;b \leq -3.4 \cdot 10^{-264}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;b \leq 8.5 \cdot 10^{+65}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;b \leq 2.15 \cdot 10^{+170}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;y \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.26e32 or 8.50000000000000075e65 < b < 2.1499999999999999e170

    1. Initial program 88.4%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 73.6%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around 0 56.3%

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

    if -1.26e32 < b < -2.1500000000000001e-147

    1. Initial program 97.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 39.4%

      \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]
    3. Taylor expanded in b around 0 39.4%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg39.4%

        \[\leadsto \color{blue}{-y \cdot z} \]
      2. *-commutative39.4%

        \[\leadsto -\color{blue}{z \cdot y} \]
      3. distribute-rgt-neg-in39.4%

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]
    5. Simplified39.4%

      \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]

    if -2.1500000000000001e-147 < b < -3.3999999999999999e-264

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 93.6%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 67.3%

      \[\leadsto x - \color{blue}{z \cdot \left(y - 1\right)} \]
    4. Step-by-step derivation
      1. sub-neg67.3%

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval67.3%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in67.3%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-167.3%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg67.3%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative67.3%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified67.3%

      \[\leadsto x - \color{blue}{\left(z \cdot y - z\right)} \]
    6. Taylor expanded in y around 0 44.9%

      \[\leadsto \color{blue}{z + x} \]

    if -3.3999999999999999e-264 < b < 8.50000000000000075e65

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 89.2%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 72.1%

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

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg72.2%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval72.2%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def72.1%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-172.1%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg72.1%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in72.1%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-172.1%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg72.1%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative72.1%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified72.1%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in z around 0 36.8%

      \[\leadsto \color{blue}{a + x} \]
    7. Step-by-step derivation
      1. +-commutative36.8%

        \[\leadsto \color{blue}{x + a} \]
    8. Simplified36.8%

      \[\leadsto \color{blue}{x + a} \]

    if 2.1499999999999999e170 < b

    1. Initial program 89.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 93.9%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around inf 64.9%

      \[\leadsto \color{blue}{y \cdot b} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification47.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.26 \cdot 10^{+32}:\\ \;\;\;\;b \cdot \left(t - 2\right)\\ \mathbf{elif}\;b \leq -2.15 \cdot 10^{-147}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;b \leq -3.4 \cdot 10^{-264}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{+65}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{+170}:\\ \;\;\;\;b \cdot \left(t - 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \]

Alternative 12: 49.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(t - 2\right)\\ t_2 := y \cdot \left(b - z\right)\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-71}:\\ \;\;\;\;a - t \cdot a\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-293}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-144}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 175000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- t 2.0))) (t_2 (* y (- b z))))
   (if (<= y -1.3e+37)
     t_2
     (if (<= y -1.55e-71)
       (- a (* t a))
       (if (<= y 2.1e-293)
         t_1
         (if (<= y 7.2e-144) (+ x z) (if (<= y 175000.0) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (t - 2.0);
	double t_2 = y * (b - z);
	double tmp;
	if (y <= -1.3e+37) {
		tmp = t_2;
	} else if (y <= -1.55e-71) {
		tmp = a - (t * a);
	} else if (y <= 2.1e-293) {
		tmp = t_1;
	} else if (y <= 7.2e-144) {
		tmp = x + z;
	} else if (y <= 175000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = b * (t - 2.0d0)
    t_2 = y * (b - z)
    if (y <= (-1.3d+37)) then
        tmp = t_2
    else if (y <= (-1.55d-71)) then
        tmp = a - (t * a)
    else if (y <= 2.1d-293) then
        tmp = t_1
    else if (y <= 7.2d-144) then
        tmp = x + z
    else if (y <= 175000.0d0) then
        tmp = 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 t_1 = b * (t - 2.0);
	double t_2 = y * (b - z);
	double tmp;
	if (y <= -1.3e+37) {
		tmp = t_2;
	} else if (y <= -1.55e-71) {
		tmp = a - (t * a);
	} else if (y <= 2.1e-293) {
		tmp = t_1;
	} else if (y <= 7.2e-144) {
		tmp = x + z;
	} else if (y <= 175000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (t - 2.0)
	t_2 = y * (b - z)
	tmp = 0
	if y <= -1.3e+37:
		tmp = t_2
	elif y <= -1.55e-71:
		tmp = a - (t * a)
	elif y <= 2.1e-293:
		tmp = t_1
	elif y <= 7.2e-144:
		tmp = x + z
	elif y <= 175000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(t - 2.0))
	t_2 = Float64(y * Float64(b - z))
	tmp = 0.0
	if (y <= -1.3e+37)
		tmp = t_2;
	elseif (y <= -1.55e-71)
		tmp = Float64(a - Float64(t * a));
	elseif (y <= 2.1e-293)
		tmp = t_1;
	elseif (y <= 7.2e-144)
		tmp = Float64(x + z);
	elseif (y <= 175000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (t - 2.0);
	t_2 = y * (b - z);
	tmp = 0.0;
	if (y <= -1.3e+37)
		tmp = t_2;
	elseif (y <= -1.55e-71)
		tmp = a - (t * a);
	elseif (y <= 2.1e-293)
		tmp = t_1;
	elseif (y <= 7.2e-144)
		tmp = x + z;
	elseif (y <= 175000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(t - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+37], t$95$2, If[LessEqual[y, -1.55e-71], N[(a - N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-293], t$95$1, If[LessEqual[y, 7.2e-144], N[(x + z), $MachinePrecision], If[LessEqual[y, 175000.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(t - 2\right)\\
t_2 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+37}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.55 \cdot 10^{-71}:\\
\;\;\;\;a - t \cdot a\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-293}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-144}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;y \leq 175000:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.3e37 or 175000 < y

    1. Initial program 92.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 70.9%

      \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]

    if -1.3e37 < y < -1.55000000000000001e-71

    1. Initial program 95.8%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around inf 63.8%

      \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
    3. Step-by-step derivation
      1. sub-neg63.8%

        \[\leadsto a \cdot \color{blue}{\left(1 + \left(-t\right)\right)} \]
      2. distribute-lft-in63.8%

        \[\leadsto \color{blue}{a \cdot 1 + a \cdot \left(-t\right)} \]
      3. *-rgt-identity63.8%

        \[\leadsto \color{blue}{a} + a \cdot \left(-t\right) \]
      4. distribute-rgt-neg-in63.8%

        \[\leadsto a + \color{blue}{\left(-a \cdot t\right)} \]
      5. sub-neg63.8%

        \[\leadsto \color{blue}{a - a \cdot t} \]
      6. *-commutative63.8%

        \[\leadsto a - \color{blue}{t \cdot a} \]
    4. Simplified63.8%

      \[\leadsto \color{blue}{a - t \cdot a} \]

    if -1.55000000000000001e-71 < y < 2.10000000000000005e-293 or 7.2000000000000001e-144 < y < 175000

    1. Initial program 98.7%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 46.5%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around 0 46.5%

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

    if 2.10000000000000005e-293 < y < 7.2000000000000001e-144

    1. Initial program 96.4%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 75.7%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 51.6%

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

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval51.6%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in51.6%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-151.6%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg51.6%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative51.6%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified51.6%

      \[\leadsto x - \color{blue}{\left(z \cdot y - z\right)} \]
    6. Taylor expanded in y around 0 51.6%

      \[\leadsto \color{blue}{z + x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification60.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-71}:\\ \;\;\;\;a - t \cdot a\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-293}:\\ \;\;\;\;b \cdot \left(t - 2\right)\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-144}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 175000:\\ \;\;\;\;b \cdot \left(t - 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \end{array} \]

Alternative 13: 55.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -5.5 \cdot 10^{+31}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -2.8 \cdot 10^{-241}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -6.2 \cdot 10^{-307}:\\
\;\;\;\;a - t \cdot a\\

\mathbf{elif}\;b \leq 7.6 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.50000000000000002e31 or 7.6e21 < b

    1. Initial program 89.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 77.4%

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

    if -5.50000000000000002e31 < b < -2.7999999999999999e-241 or -6.1999999999999996e-307 < b < 7.6e21

    1. Initial program 99.2%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 90.3%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in y around inf 51.8%

      \[\leadsto x - \color{blue}{y \cdot z} \]
    4. Step-by-step derivation
      1. *-commutative51.8%

        \[\leadsto x - \color{blue}{z \cdot y} \]
    5. Simplified51.8%

      \[\leadsto x - \color{blue}{z \cdot y} \]

    if -2.7999999999999999e-241 < b < -6.1999999999999996e-307

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around inf 55.7%

      \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
    3. Step-by-step derivation
      1. sub-neg55.7%

        \[\leadsto a \cdot \color{blue}{\left(1 + \left(-t\right)\right)} \]
      2. distribute-lft-in55.7%

        \[\leadsto \color{blue}{a \cdot 1 + a \cdot \left(-t\right)} \]
      3. *-rgt-identity55.7%

        \[\leadsto \color{blue}{a} + a \cdot \left(-t\right) \]
      4. distribute-rgt-neg-in55.7%

        \[\leadsto a + \color{blue}{\left(-a \cdot t\right)} \]
      5. sub-neg55.7%

        \[\leadsto \color{blue}{a - a \cdot t} \]
      6. *-commutative55.7%

        \[\leadsto a - \color{blue}{t \cdot a} \]
    4. Simplified55.7%

      \[\leadsto \color{blue}{a - t \cdot a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{+31}:\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{elif}\;b \leq -2.8 \cdot 10^{-241}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-307}:\\ \;\;\;\;a - t \cdot a\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{+21}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \end{array} \]

Alternative 14: 31.6% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{+86}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq -29000000:\\ \;\;\;\;x + a\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-149}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-264}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{+128}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -4.4e+86)
   (* t b)
   (if (<= b -29000000.0)
     (+ x a)
     (if (<= b -2.3e-149)
       (* z (- y))
       (if (<= b -1.05e-264) (+ x z) (if (<= b 4.9e+128) (+ x a) (* y b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -4.4e+86) {
		tmp = t * b;
	} else if (b <= -29000000.0) {
		tmp = x + a;
	} else if (b <= -2.3e-149) {
		tmp = z * -y;
	} else if (b <= -1.05e-264) {
		tmp = x + z;
	} else if (b <= 4.9e+128) {
		tmp = x + a;
	} else {
		tmp = y * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-4.4d+86)) then
        tmp = t * b
    else if (b <= (-29000000.0d0)) then
        tmp = x + a
    else if (b <= (-2.3d-149)) then
        tmp = z * -y
    else if (b <= (-1.05d-264)) then
        tmp = x + z
    else if (b <= 4.9d+128) then
        tmp = x + a
    else
        tmp = y * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -4.4e+86) {
		tmp = t * b;
	} else if (b <= -29000000.0) {
		tmp = x + a;
	} else if (b <= -2.3e-149) {
		tmp = z * -y;
	} else if (b <= -1.05e-264) {
		tmp = x + z;
	} else if (b <= 4.9e+128) {
		tmp = x + a;
	} else {
		tmp = y * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -4.4e+86:
		tmp = t * b
	elif b <= -29000000.0:
		tmp = x + a
	elif b <= -2.3e-149:
		tmp = z * -y
	elif b <= -1.05e-264:
		tmp = x + z
	elif b <= 4.9e+128:
		tmp = x + a
	else:
		tmp = y * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -4.4e+86)
		tmp = Float64(t * b);
	elseif (b <= -29000000.0)
		tmp = Float64(x + a);
	elseif (b <= -2.3e-149)
		tmp = Float64(z * Float64(-y));
	elseif (b <= -1.05e-264)
		tmp = Float64(x + z);
	elseif (b <= 4.9e+128)
		tmp = Float64(x + a);
	else
		tmp = Float64(y * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -4.4e+86)
		tmp = t * b;
	elseif (b <= -29000000.0)
		tmp = x + a;
	elseif (b <= -2.3e-149)
		tmp = z * -y;
	elseif (b <= -1.05e-264)
		tmp = x + z;
	elseif (b <= 4.9e+128)
		tmp = x + a;
	else
		tmp = y * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.4e+86], N[(t * b), $MachinePrecision], If[LessEqual[b, -29000000.0], N[(x + a), $MachinePrecision], If[LessEqual[b, -2.3e-149], N[(z * (-y)), $MachinePrecision], If[LessEqual[b, -1.05e-264], N[(x + z), $MachinePrecision], If[LessEqual[b, 4.9e+128], N[(x + a), $MachinePrecision], N[(y * b), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{+86}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;b \leq -29000000:\\
\;\;\;\;x + a\\

\mathbf{elif}\;b \leq -2.3 \cdot 10^{-149}:\\
\;\;\;\;z \cdot \left(-y\right)\\

\mathbf{elif}\;b \leq -1.05 \cdot 10^{-264}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;b \leq 4.9 \cdot 10^{+128}:\\
\;\;\;\;x + a\\

\mathbf{else}:\\
\;\;\;\;y \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -4.40000000000000006e86

    1. Initial program 88.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 83.0%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in t around inf 43.9%

      \[\leadsto \color{blue}{t \cdot b} \]

    if -4.40000000000000006e86 < b < -2.9e7 or -1.0500000000000001e-264 < b < 4.90000000000000018e128

    1. Initial program 97.2%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 80.5%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 66.3%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def66.3%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg66.3%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval66.3%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def66.3%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-166.3%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg66.3%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in66.3%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-166.3%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg66.3%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative66.3%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified66.3%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in z around 0 36.3%

      \[\leadsto \color{blue}{a + x} \]
    7. Step-by-step derivation
      1. +-commutative36.3%

        \[\leadsto \color{blue}{x + a} \]
    8. Simplified36.3%

      \[\leadsto \color{blue}{x + a} \]

    if -2.9e7 < b < -2.3e-149

    1. Initial program 97.1%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 42.8%

      \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]
    3. Taylor expanded in b around 0 42.7%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg42.7%

        \[\leadsto \color{blue}{-y \cdot z} \]
      2. *-commutative42.7%

        \[\leadsto -\color{blue}{z \cdot y} \]
      3. distribute-rgt-neg-in42.7%

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]
    5. Simplified42.7%

      \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]

    if -2.3e-149 < b < -1.0500000000000001e-264

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 93.6%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 67.3%

      \[\leadsto x - \color{blue}{z \cdot \left(y - 1\right)} \]
    4. Step-by-step derivation
      1. sub-neg67.3%

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval67.3%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in67.3%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-167.3%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg67.3%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative67.3%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified67.3%

      \[\leadsto x - \color{blue}{\left(z \cdot y - z\right)} \]
    6. Taylor expanded in y around 0 44.9%

      \[\leadsto \color{blue}{z + x} \]

    if 4.90000000000000018e128 < b

    1. Initial program 91.4%

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

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around inf 61.1%

      \[\leadsto \color{blue}{y \cdot b} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification43.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{+86}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq -29000000:\\ \;\;\;\;x + a\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-149}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-264}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{+128}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \]

Alternative 15: 72.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{+32} \lor \neg \left(b \leq 2.9 \cdot 10^{+59}\right):\\
\;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.2499999999999999e32 or 2.89999999999999991e59 < b

    1. Initial program 88.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around 0 85.9%

      \[\leadsto \color{blue}{\left(\left(\left(y + t\right) - 2\right) \cdot b + x\right) - z \cdot \left(y - 1\right)} \]
    3. Taylor expanded in z around 0 83.7%

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

    if -1.2499999999999999e32 < b < 2.89999999999999991e59

    1. Initial program 99.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 90.1%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 72.2%

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

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg72.2%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval72.2%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def72.2%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-172.2%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg72.2%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in72.2%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-172.2%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg72.2%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative72.2%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified72.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+32} \lor \neg \left(b \leq 2.9 \cdot 10^{+59}\right):\\ \;\;\;\;x + b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a + \left(z - y \cdot z\right)\right)\\ \end{array} \]

Alternative 16: 33.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.8 \cdot 10^{+88}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{-42}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-264}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{+133}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -6.8e+88)
   (* t b)
   (if (<= b -7.2e-42)
     (+ x a)
     (if (<= b -2.3e-264) (+ x z) (if (<= b 6.9e+133) (+ x a) (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -6.8e+88) {
		tmp = t * b;
	} else if (b <= -7.2e-42) {
		tmp = x + a;
	} else if (b <= -2.3e-264) {
		tmp = x + z;
	} else if (b <= 6.9e+133) {
		tmp = x + a;
	} else {
		tmp = y * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-6.8d+88)) then
        tmp = t * b
    else if (b <= (-7.2d-42)) then
        tmp = x + a
    else if (b <= (-2.3d-264)) then
        tmp = x + z
    else if (b <= 6.9d+133) then
        tmp = x + a
    else
        tmp = y * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -6.8e+88) {
		tmp = t * b;
	} else if (b <= -7.2e-42) {
		tmp = x + a;
	} else if (b <= -2.3e-264) {
		tmp = x + z;
	} else if (b <= 6.9e+133) {
		tmp = x + a;
	} else {
		tmp = y * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -6.8e+88:
		tmp = t * b
	elif b <= -7.2e-42:
		tmp = x + a
	elif b <= -2.3e-264:
		tmp = x + z
	elif b <= 6.9e+133:
		tmp = x + a
	else:
		tmp = y * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -6.8e+88)
		tmp = Float64(t * b);
	elseif (b <= -7.2e-42)
		tmp = Float64(x + a);
	elseif (b <= -2.3e-264)
		tmp = Float64(x + z);
	elseif (b <= 6.9e+133)
		tmp = Float64(x + a);
	else
		tmp = Float64(y * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -6.8e+88)
		tmp = t * b;
	elseif (b <= -7.2e-42)
		tmp = x + a;
	elseif (b <= -2.3e-264)
		tmp = x + z;
	elseif (b <= 6.9e+133)
		tmp = x + a;
	else
		tmp = y * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.8e+88], N[(t * b), $MachinePrecision], If[LessEqual[b, -7.2e-42], N[(x + a), $MachinePrecision], If[LessEqual[b, -2.3e-264], N[(x + z), $MachinePrecision], If[LessEqual[b, 6.9e+133], N[(x + a), $MachinePrecision], N[(y * b), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.8 \cdot 10^{+88}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;b \leq -7.2 \cdot 10^{-42}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;b \leq -2.3 \cdot 10^{-264}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;b \leq 6.9 \cdot 10^{+133}:\\
\;\;\;\;x + a\\

\mathbf{else}:\\
\;\;\;\;y \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -6.80000000000000008e88

    1. Initial program 88.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 83.0%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in t around inf 43.9%

      \[\leadsto \color{blue}{t \cdot b} \]

    if -6.80000000000000008e88 < b < -7.2000000000000004e-42 or -2.30000000000000012e-264 < b < 6.9000000000000002e133

    1. Initial program 96.5%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 81.3%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 67.6%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def67.6%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg67.6%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval67.6%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def67.6%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-167.6%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg67.6%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in67.6%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-167.6%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg67.6%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative67.6%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified67.6%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in z around 0 35.2%

      \[\leadsto \color{blue}{a + x} \]
    7. Step-by-step derivation
      1. +-commutative35.2%

        \[\leadsto \color{blue}{x + a} \]
    8. Simplified35.2%

      \[\leadsto \color{blue}{x + a} \]

    if -7.2000000000000004e-42 < b < -2.30000000000000012e-264

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 91.1%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around 0 65.6%

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

        \[\leadsto x - z \cdot \color{blue}{\left(y + \left(-1\right)\right)} \]
      2. metadata-eval65.6%

        \[\leadsto x - z \cdot \left(y + \color{blue}{-1}\right) \]
      3. distribute-rgt-in65.6%

        \[\leadsto x - \color{blue}{\left(y \cdot z + -1 \cdot z\right)} \]
      4. neg-mul-165.6%

        \[\leadsto x - \left(y \cdot z + \color{blue}{\left(-z\right)}\right) \]
      5. unsub-neg65.6%

        \[\leadsto x - \color{blue}{\left(y \cdot z - z\right)} \]
      6. *-commutative65.6%

        \[\leadsto x - \left(\color{blue}{z \cdot y} - z\right) \]
    5. Simplified65.6%

      \[\leadsto x - \color{blue}{\left(z \cdot y - z\right)} \]
    6. Taylor expanded in y around 0 38.6%

      \[\leadsto \color{blue}{z + x} \]

    if 6.9000000000000002e133 < b

    1. Initial program 91.4%

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

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around inf 61.1%

      \[\leadsto \color{blue}{y \cdot b} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification41.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.8 \cdot 10^{+88}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{-42}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-264}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{+133}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \]

Alternative 17: 61.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{+90} \lor \neg \left(b \leq 3.5 \cdot 10^{+63}\right):\\
\;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(a - t \cdot a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.2500000000000001e90 or 3.50000000000000029e63 < b

    1. Initial program 88.6%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 83.0%

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

    if -1.2500000000000001e90 < b < 3.50000000000000029e63

    1. Initial program 98.7%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 87.2%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in a around inf 53.2%

      \[\leadsto x - \color{blue}{\left(t - 1\right) \cdot a} \]
    4. Step-by-step derivation
      1. sub-neg53.2%

        \[\leadsto x - \color{blue}{\left(t + \left(-1\right)\right)} \cdot a \]
      2. metadata-eval53.2%

        \[\leadsto x - \left(t + \color{blue}{-1}\right) \cdot a \]
      3. *-commutative53.2%

        \[\leadsto x - \color{blue}{a \cdot \left(t + -1\right)} \]
      4. distribute-rgt-in53.2%

        \[\leadsto x - \color{blue}{\left(t \cdot a + -1 \cdot a\right)} \]
      5. neg-mul-153.2%

        \[\leadsto x - \left(t \cdot a + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg53.2%

        \[\leadsto x - \color{blue}{\left(t \cdot a - a\right)} \]
      7. *-commutative53.2%

        \[\leadsto x - \left(\color{blue}{a \cdot t} - a\right) \]
    5. Simplified53.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+90} \lor \neg \left(b \leq 3.5 \cdot 10^{+63}\right):\\ \;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a - t \cdot a\right)\\ \end{array} \]

Alternative 18: 50.1% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+14} \lor \neg \left(t \leq 20000\right):\\
\;\;\;\;t \cdot \left(b - a\right)\\

\mathbf{else}:\\
\;\;\;\;x + a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.6e14 or 2e4 < t

    1. Initial program 90.7%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in t around inf 65.8%

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]

    if -3.6e14 < t < 2e4

    1. Initial program 98.5%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 65.7%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 65.1%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def65.1%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg65.1%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval65.1%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def65.1%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-165.1%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg65.1%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in65.1%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-165.1%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg65.1%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative65.1%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified65.1%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in z around 0 35.4%

      \[\leadsto \color{blue}{a + x} \]
    7. Step-by-step derivation
      1. +-commutative35.4%

        \[\leadsto \color{blue}{x + a} \]
    8. Simplified35.4%

      \[\leadsto \color{blue}{x + a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{+14} \lor \neg \left(t \leq 20000\right):\\ \;\;\;\;t \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + a\\ \end{array} \]

Alternative 19: 19.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-116}:\\ \;\;\;\;b \cdot -2\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+76}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -4.2e+86)
   x
   (if (<= x 5.8e-116) (* b -2.0) (if (<= x 7.5e+76) a x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -4.2e+86) {
		tmp = x;
	} else if (x <= 5.8e-116) {
		tmp = b * -2.0;
	} else if (x <= 7.5e+76) {
		tmp = a;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (x <= (-4.2d+86)) then
        tmp = x
    else if (x <= 5.8d-116) then
        tmp = b * (-2.0d0)
    else if (x <= 7.5d+76) then
        tmp = a
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -4.2e+86) {
		tmp = x;
	} else if (x <= 5.8e-116) {
		tmp = b * -2.0;
	} else if (x <= 7.5e+76) {
		tmp = a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -4.2e+86:
		tmp = x
	elif x <= 5.8e-116:
		tmp = b * -2.0
	elif x <= 7.5e+76:
		tmp = a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -4.2e+86)
		tmp = x;
	elseif (x <= 5.8e-116)
		tmp = Float64(b * -2.0);
	elseif (x <= 7.5e+76)
		tmp = a;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -4.2e+86)
		tmp = x;
	elseif (x <= 5.8e-116)
		tmp = b * -2.0;
	elseif (x <= 7.5e+76)
		tmp = a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.2e+86], x, If[LessEqual[x, 5.8e-116], N[(b * -2.0), $MachinePrecision], If[LessEqual[x, 7.5e+76], a, x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+86}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 5.8 \cdot 10^{-116}:\\
\;\;\;\;b \cdot -2\\

\mathbf{elif}\;x \leq 7.5 \cdot 10^{+76}:\\
\;\;\;\;a\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.1999999999999998e86 or 7.4999999999999995e76 < x

    1. Initial program 94.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in x around inf 35.5%

      \[\leadsto \color{blue}{x} \]

    if -4.1999999999999998e86 < x < 5.7999999999999996e-116

    1. Initial program 93.6%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in y around inf 62.2%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    3. Step-by-step derivation
      1. mul-1-neg62.2%

        \[\leadsto \color{blue}{\left(-y \cdot z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. distribute-rgt-neg-in62.2%

        \[\leadsto \color{blue}{y \cdot \left(-z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    4. Simplified62.2%

      \[\leadsto \color{blue}{y \cdot \left(-z\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    5. Taylor expanded in y around 0 31.5%

      \[\leadsto \color{blue}{\left(t - 2\right) \cdot b} \]
    6. Taylor expanded in t around 0 14.0%

      \[\leadsto \color{blue}{-2 \cdot b} \]
    7. Step-by-step derivation
      1. *-commutative14.0%

        \[\leadsto \color{blue}{b \cdot -2} \]
    8. Simplified14.0%

      \[\leadsto \color{blue}{b \cdot -2} \]

    if 5.7999999999999996e-116 < x < 7.4999999999999995e76

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around inf 33.0%

      \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
    3. Step-by-step derivation
      1. sub-neg33.0%

        \[\leadsto a \cdot \color{blue}{\left(1 + \left(-t\right)\right)} \]
      2. distribute-lft-in33.0%

        \[\leadsto \color{blue}{a \cdot 1 + a \cdot \left(-t\right)} \]
      3. *-rgt-identity33.0%

        \[\leadsto \color{blue}{a} + a \cdot \left(-t\right) \]
      4. distribute-rgt-neg-in33.0%

        \[\leadsto a + \color{blue}{\left(-a \cdot t\right)} \]
      5. sub-neg33.0%

        \[\leadsto \color{blue}{a - a \cdot t} \]
      6. *-commutative33.0%

        \[\leadsto a - \color{blue}{t \cdot a} \]
    4. Simplified33.0%

      \[\leadsto \color{blue}{a - t \cdot a} \]
    5. Taylor expanded in t around 0 23.7%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification22.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-116}:\\ \;\;\;\;b \cdot -2\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+76}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 20: 26.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{+19}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.7e+19) (* t b) (if (<= b 5.5e+16) x (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.7e+19) {
		tmp = t * b;
	} else if (b <= 5.5e+16) {
		tmp = x;
	} else {
		tmp = t * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-1.7d+19)) then
        tmp = t * b
    else if (b <= 5.5d+16) then
        tmp = x
    else
        tmp = t * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.7e+19) {
		tmp = t * b;
	} else if (b <= 5.5e+16) {
		tmp = x;
	} else {
		tmp = t * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.7e+19:
		tmp = t * b
	elif b <= 5.5e+16:
		tmp = x
	else:
		tmp = t * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.7e+19)
		tmp = Float64(t * b);
	elseif (b <= 5.5e+16)
		tmp = x;
	else
		tmp = Float64(t * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -1.7e+19)
		tmp = t * b;
	elseif (b <= 5.5e+16)
		tmp = x;
	else
		tmp = t * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.7e+19], N[(t * b), $MachinePrecision], If[LessEqual[b, 5.5e+16], x, N[(t * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+19}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;b \leq 5.5 \cdot 10^{+16}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.7e19 or 5.5e16 < b

    1. Initial program 89.6%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 74.8%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in t around inf 30.5%

      \[\leadsto \color{blue}{t \cdot b} \]

    if -1.7e19 < b < 5.5e16

    1. Initial program 99.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in x around inf 20.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{+19}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \]

Alternative 21: 25.8% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+14}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{+108}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.8e+14) (* t b) (if (<= b 2.6e+108) x (* y b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.8e+14) {
		tmp = t * b;
	} else if (b <= 2.6e+108) {
		tmp = x;
	} else {
		tmp = y * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-1.8d+14)) then
        tmp = t * b
    else if (b <= 2.6d+108) then
        tmp = x
    else
        tmp = y * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.8e+14) {
		tmp = t * b;
	} else if (b <= 2.6e+108) {
		tmp = x;
	} else {
		tmp = y * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.8e+14:
		tmp = t * b
	elif b <= 2.6e+108:
		tmp = x
	else:
		tmp = y * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.8e+14)
		tmp = Float64(t * b);
	elseif (b <= 2.6e+108)
		tmp = x;
	else
		tmp = Float64(y * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -1.8e+14)
		tmp = t * b;
	elseif (b <= 2.6e+108)
		tmp = x;
	else
		tmp = y * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.8e+14], N[(t * b), $MachinePrecision], If[LessEqual[b, 2.6e+108], x, N[(y * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+14}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{+108}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.8e14

    1. Initial program 88.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 73.9%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in t around inf 38.4%

      \[\leadsto \color{blue}{t \cdot b} \]

    if -1.8e14 < b < 2.6000000000000002e108

    1. Initial program 98.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in x around inf 19.3%

      \[\leadsto \color{blue}{x} \]

    if 2.6000000000000002e108 < b

    1. Initial program 92.1%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 92.1%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around inf 59.0%

      \[\leadsto \color{blue}{y \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification29.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+14}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{+108}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \]

Alternative 22: 33.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{+89}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+128}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -7.5e+89) (* t b) (if (<= b 1.6e+128) (+ x a) (* y b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -7.5e+89) {
		tmp = t * b;
	} else if (b <= 1.6e+128) {
		tmp = x + a;
	} else {
		tmp = y * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-7.5d+89)) then
        tmp = t * b
    else if (b <= 1.6d+128) then
        tmp = x + a
    else
        tmp = y * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -7.5e+89) {
		tmp = t * b;
	} else if (b <= 1.6e+128) {
		tmp = x + a;
	} else {
		tmp = y * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -7.5e+89:
		tmp = t * b
	elif b <= 1.6e+128:
		tmp = x + a
	else:
		tmp = y * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -7.5e+89)
		tmp = Float64(t * b);
	elseif (b <= 1.6e+128)
		tmp = Float64(x + a);
	else
		tmp = Float64(y * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -7.5e+89)
		tmp = t * b;
	elseif (b <= 1.6e+128)
		tmp = x + a;
	else
		tmp = y * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -7.5e+89], N[(t * b), $MachinePrecision], If[LessEqual[b, 1.6e+128], N[(x + a), $MachinePrecision], N[(y * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+89}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;b \leq 1.6 \cdot 10^{+128}:\\
\;\;\;\;x + a\\

\mathbf{else}:\\
\;\;\;\;y \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.49999999999999947e89

    1. Initial program 88.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around inf 83.0%

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in t around inf 43.9%

      \[\leadsto \color{blue}{t \cdot b} \]

    if -7.49999999999999947e89 < b < 1.59999999999999993e128

    1. Initial program 97.6%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in b around 0 84.4%

      \[\leadsto \color{blue}{x - \left(\left(t - 1\right) \cdot a + z \cdot \left(y - 1\right)\right)} \]
    3. Taylor expanded in t around 0 68.0%

      \[\leadsto x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)} \]
    4. Step-by-step derivation
      1. fma-def68.0%

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y - 1, -1 \cdot a\right)} \]
      2. sub-neg68.0%

        \[\leadsto x - \mathsf{fma}\left(z, \color{blue}{y + \left(-1\right)}, -1 \cdot a\right) \]
      3. metadata-eval68.0%

        \[\leadsto x - \mathsf{fma}\left(z, y + \color{blue}{-1}, -1 \cdot a\right) \]
      4. fma-def68.0%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) + -1 \cdot a\right)} \]
      5. neg-mul-168.0%

        \[\leadsto x - \left(z \cdot \left(y + -1\right) + \color{blue}{\left(-a\right)}\right) \]
      6. unsub-neg68.0%

        \[\leadsto x - \color{blue}{\left(z \cdot \left(y + -1\right) - a\right)} \]
      7. distribute-rgt-in68.0%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z + -1 \cdot z\right)} - a\right) \]
      8. neg-mul-168.0%

        \[\leadsto x - \left(\left(y \cdot z + \color{blue}{\left(-z\right)}\right) - a\right) \]
      9. unsub-neg68.0%

        \[\leadsto x - \left(\color{blue}{\left(y \cdot z - z\right)} - a\right) \]
      10. *-commutative68.0%

        \[\leadsto x - \left(\left(\color{blue}{z \cdot y} - z\right) - a\right) \]
    5. Simplified68.0%

      \[\leadsto x - \color{blue}{\left(\left(z \cdot y - z\right) - a\right)} \]
    6. Taylor expanded in z around 0 31.9%

      \[\leadsto \color{blue}{a + x} \]
    7. Step-by-step derivation
      1. +-commutative31.9%

        \[\leadsto \color{blue}{x + a} \]
    8. Simplified31.9%

      \[\leadsto \color{blue}{x + a} \]

    if 1.59999999999999993e128 < b

    1. Initial program 91.4%

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

      \[\leadsto \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
    3. Taylor expanded in y around inf 61.1%

      \[\leadsto \color{blue}{y \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification38.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{+89}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+128}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;y \cdot b\\ \end{array} \]

Alternative 23: 21.4% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+75}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -1.85e+86) x (if (<= x 2.6e+75) a x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.85e+86) {
		tmp = x;
	} else if (x <= 2.6e+75) {
		tmp = a;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (x <= (-1.85d+86)) then
        tmp = x
    else if (x <= 2.6d+75) then
        tmp = a
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.85e+86) {
		tmp = x;
	} else if (x <= 2.6e+75) {
		tmp = a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -1.85e+86:
		tmp = x
	elif x <= 2.6e+75:
		tmp = a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -1.85e+86)
		tmp = x;
	elseif (x <= 2.6e+75)
		tmp = a;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -1.85e+86)
		tmp = x;
	elseif (x <= 2.6e+75)
		tmp = a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.85e+86], x, If[LessEqual[x, 2.6e+75], a, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+86}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 2.6 \cdot 10^{+75}:\\
\;\;\;\;a\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.84999999999999996e86 or 2.59999999999999985e75 < x

    1. Initial program 94.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in x around inf 35.5%

      \[\leadsto \color{blue}{x} \]

    if -1.84999999999999996e86 < x < 2.59999999999999985e75

    1. Initial program 95.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Taylor expanded in a around inf 33.1%

      \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
    3. Step-by-step derivation
      1. sub-neg33.1%

        \[\leadsto a \cdot \color{blue}{\left(1 + \left(-t\right)\right)} \]
      2. distribute-lft-in33.1%

        \[\leadsto \color{blue}{a \cdot 1 + a \cdot \left(-t\right)} \]
      3. *-rgt-identity33.1%

        \[\leadsto \color{blue}{a} + a \cdot \left(-t\right) \]
      4. distribute-rgt-neg-in33.1%

        \[\leadsto a + \color{blue}{\left(-a \cdot t\right)} \]
      5. sub-neg33.1%

        \[\leadsto \color{blue}{a - a \cdot t} \]
      6. *-commutative33.1%

        \[\leadsto a - \color{blue}{t \cdot a} \]
    4. Simplified33.1%

      \[\leadsto \color{blue}{a - t \cdot a} \]
    5. Taylor expanded in t around 0 14.2%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification21.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+75}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 24: 11.4% accurate, 21.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
	return a;
}
real(8) function code(x, y, z, t, a, b)
    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
    code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return a;
}
def code(x, y, z, t, a, b):
	return a
function code(x, y, z, t, a, b)
	return a
end
function tmp = code(x, y, z, t, a, b)
	tmp = a;
end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}

\\
a
\end{array}
Derivation
  1. Initial program 94.9%

    \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
  2. Taylor expanded in a around inf 27.9%

    \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
  3. Step-by-step derivation
    1. sub-neg27.9%

      \[\leadsto a \cdot \color{blue}{\left(1 + \left(-t\right)\right)} \]
    2. distribute-lft-in27.9%

      \[\leadsto \color{blue}{a \cdot 1 + a \cdot \left(-t\right)} \]
    3. *-rgt-identity27.9%

      \[\leadsto \color{blue}{a} + a \cdot \left(-t\right) \]
    4. distribute-rgt-neg-in27.9%

      \[\leadsto a + \color{blue}{\left(-a \cdot t\right)} \]
    5. sub-neg27.9%

      \[\leadsto \color{blue}{a - a \cdot t} \]
    6. *-commutative27.9%

      \[\leadsto a - \color{blue}{t \cdot a} \]
  4. Simplified27.9%

    \[\leadsto \color{blue}{a - t \cdot a} \]
  5. Taylor expanded in t around 0 11.4%

    \[\leadsto \color{blue}{a} \]
  6. Final simplification11.4%

    \[\leadsto a \]

Reproduce

?
herbie shell --seed 2023192 
(FPCore (x y z t a b)
  :name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
  :precision binary64
  (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))