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

Percentage Accurate: 95.2% → 97.2%
Time: 12.5s
Alternatives: 18
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 18 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.2% 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: 97.2% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.9 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(y + \left(t + -2\right), b, x - \mathsf{fma}\left(y + -1, z, a \cdot \left(t + -1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.90000000000000007e180

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

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

        \[\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. associate--l+99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.90000000000000007e180 < b

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in a around 0 92.9%

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

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

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

Alternative 2: 97.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) 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 \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) 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. Add Preprocessing
    3. Taylor expanded in b around inf 70.0%

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

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

Alternative 3: 33.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(1 - t\right)\\ t_2 := z \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -2.5 \cdot 10^{+129}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+48}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+47}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-143}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-218}:\\ \;\;\;\;b \cdot t\\ \mathbf{elif}\;y \leq 68000000000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (- 1.0 t))) (t_2 (* z (- y))))
   (if (<= y -2.5e+129)
     (* b y)
     (if (<= y -7.2e+48)
       t_2
       (if (<= y -5.2e+47)
         (* b y)
         (if (<= y -3e-143)
           t_1
           (if (<= y 1.8e-218)
             (* b t)
             (if (<= y 68000000000000.0) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (1.0 - t);
	double t_2 = z * -y;
	double tmp;
	if (y <= -2.5e+129) {
		tmp = b * y;
	} else if (y <= -7.2e+48) {
		tmp = t_2;
	} else if (y <= -5.2e+47) {
		tmp = b * y;
	} else if (y <= -3e-143) {
		tmp = t_1;
	} else if (y <= 1.8e-218) {
		tmp = b * t;
	} else if (y <= 68000000000000.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 = a * (1.0d0 - t)
    t_2 = z * -y
    if (y <= (-2.5d+129)) then
        tmp = b * y
    else if (y <= (-7.2d+48)) then
        tmp = t_2
    else if (y <= (-5.2d+47)) then
        tmp = b * y
    else if (y <= (-3d-143)) then
        tmp = t_1
    else if (y <= 1.8d-218) then
        tmp = b * t
    else if (y <= 68000000000000.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 = a * (1.0 - t);
	double t_2 = z * -y;
	double tmp;
	if (y <= -2.5e+129) {
		tmp = b * y;
	} else if (y <= -7.2e+48) {
		tmp = t_2;
	} else if (y <= -5.2e+47) {
		tmp = b * y;
	} else if (y <= -3e-143) {
		tmp = t_1;
	} else if (y <= 1.8e-218) {
		tmp = b * t;
	} else if (y <= 68000000000000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (1.0 - t)
	t_2 = z * -y
	tmp = 0
	if y <= -2.5e+129:
		tmp = b * y
	elif y <= -7.2e+48:
		tmp = t_2
	elif y <= -5.2e+47:
		tmp = b * y
	elif y <= -3e-143:
		tmp = t_1
	elif y <= 1.8e-218:
		tmp = b * t
	elif y <= 68000000000000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(1.0 - t))
	t_2 = Float64(z * Float64(-y))
	tmp = 0.0
	if (y <= -2.5e+129)
		tmp = Float64(b * y);
	elseif (y <= -7.2e+48)
		tmp = t_2;
	elseif (y <= -5.2e+47)
		tmp = Float64(b * y);
	elseif (y <= -3e-143)
		tmp = t_1;
	elseif (y <= 1.8e-218)
		tmp = Float64(b * t);
	elseif (y <= 68000000000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (1.0 - t);
	t_2 = z * -y;
	tmp = 0.0;
	if (y <= -2.5e+129)
		tmp = b * y;
	elseif (y <= -7.2e+48)
		tmp = t_2;
	elseif (y <= -5.2e+47)
		tmp = b * y;
	elseif (y <= -3e-143)
		tmp = t_1;
	elseif (y <= 1.8e-218)
		tmp = b * t;
	elseif (y <= 68000000000000.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[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-y)), $MachinePrecision]}, If[LessEqual[y, -2.5e+129], N[(b * y), $MachinePrecision], If[LessEqual[y, -7.2e+48], t$95$2, If[LessEqual[y, -5.2e+47], N[(b * y), $MachinePrecision], If[LessEqual[y, -3e-143], t$95$1, If[LessEqual[y, 1.8e-218], N[(b * t), $MachinePrecision], If[LessEqual[y, 68000000000000.0], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right)\\
t_2 := z \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+129}:\\
\;\;\;\;b \cdot y\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -5.2 \cdot 10^{+47}:\\
\;\;\;\;b \cdot y\\

\mathbf{elif}\;y \leq -3 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.8 \cdot 10^{-218}:\\
\;\;\;\;b \cdot t\\

\mathbf{elif}\;y \leq 68000000000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.5000000000000001e129 or -7.19999999999999967e48 < y < -5.20000000000000007e47

    1. Initial program 87.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. Add Preprocessing
    3. Taylor expanded in z around 0 68.4%

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

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

    if -2.5000000000000001e129 < y < -7.19999999999999967e48 or 6.8e13 < y

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

      \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
    4. Taylor expanded in y around inf 45.7%

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

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

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

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

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

    if -5.20000000000000007e47 < y < -2.99999999999999985e-143 or 1.80000000000000006e-218 < y < 6.8e13

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in a around inf 35.4%

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

    if -2.99999999999999985e-143 < y < 1.80000000000000006e-218

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

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
    4. Taylor expanded in b around inf 33.0%

      \[\leadsto \color{blue}{b \cdot t} \]
    5. Step-by-step derivation
      1. *-commutative33.0%

        \[\leadsto \color{blue}{t \cdot b} \]
    6. Simplified33.0%

      \[\leadsto \color{blue}{t \cdot b} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification40.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+129}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+48}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+47}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-143}:\\ \;\;\;\;a \cdot \left(1 - t\right)\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-218}:\\ \;\;\;\;b \cdot t\\ \mathbf{elif}\;y \leq 68000000000000:\\ \;\;\;\;a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 64.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;b \leq -950:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -1.65 \cdot 10^{-40}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b \leq 3 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.09999999999999973e36 or -950 < b < -1.64999999999999996e-40 or 1.00000000000000004e-25 < b

    1. Initial program 92.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. Add Preprocessing
    3. Taylor expanded in a around 0 86.2%

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

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

    if -5.09999999999999973e36 < b < -950 or -1.64999999999999996e-40 < b < 2.9999999999999999e-50

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

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

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

    if 2.9999999999999999e-50 < b < 1.00000000000000004e-25

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.1 \cdot 10^{+36}:\\ \;\;\;\;x - b \cdot \left(2 - \left(y + t\right)\right)\\ \mathbf{elif}\;b \leq -950:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{elif}\;b \leq -1.65 \cdot 10^{-40}:\\ \;\;\;\;x - b \cdot \left(2 - \left(y + t\right)\right)\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-50}:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{elif}\;b \leq 10^{-25}:\\ \;\;\;\;z \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - b \cdot \left(2 - \left(y + t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(z \cdot \left(1 - y\right) + a \cdot \left(1 - t\right)\right)\\ t_2 := x - b \cdot \left(2 - \left(y + t\right)\right)\\ \mathbf{if}\;b \leq -9.8 \cdot 10^{+39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.76 \cdot 10^{+87}:\\ \;\;\;\;b \cdot \left(\left(y + t\right) - 2\right) - t \cdot a\\ \mathbf{elif}\;b \leq 4 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (+ (* z (- 1.0 y)) (* a (- 1.0 t)))))
        (t_2 (- x (* b (- 2.0 (+ y t))))))
   (if (<= b -9.8e+39)
     t_2
     (if (<= b 6.6e+31)
       t_1
       (if (<= b 1.76e+87)
         (- (* b (- (+ y t) 2.0)) (* t a))
         (if (<= b 4e+101) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + ((z * (1.0 - y)) + (a * (1.0 - t)));
	double t_2 = x - (b * (2.0 - (y + t)));
	double tmp;
	if (b <= -9.8e+39) {
		tmp = t_2;
	} else if (b <= 6.6e+31) {
		tmp = t_1;
	} else if (b <= 1.76e+87) {
		tmp = (b * ((y + t) - 2.0)) - (t * a);
	} else if (b <= 4e+101) {
		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 + ((z * (1.0d0 - y)) + (a * (1.0d0 - t)))
    t_2 = x - (b * (2.0d0 - (y + t)))
    if (b <= (-9.8d+39)) then
        tmp = t_2
    else if (b <= 6.6d+31) then
        tmp = t_1
    else if (b <= 1.76d+87) then
        tmp = (b * ((y + t) - 2.0d0)) - (t * a)
    else if (b <= 4d+101) 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 * (1.0 - y)) + (a * (1.0 - t)));
	double t_2 = x - (b * (2.0 - (y + t)));
	double tmp;
	if (b <= -9.8e+39) {
		tmp = t_2;
	} else if (b <= 6.6e+31) {
		tmp = t_1;
	} else if (b <= 1.76e+87) {
		tmp = (b * ((y + t) - 2.0)) - (t * a);
	} else if (b <= 4e+101) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + ((z * (1.0 - y)) + (a * (1.0 - t)))
	t_2 = x - (b * (2.0 - (y + t)))
	tmp = 0
	if b <= -9.8e+39:
		tmp = t_2
	elif b <= 6.6e+31:
		tmp = t_1
	elif b <= 1.76e+87:
		tmp = (b * ((y + t) - 2.0)) - (t * a)
	elif b <= 4e+101:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(Float64(z * Float64(1.0 - y)) + Float64(a * Float64(1.0 - t))))
	t_2 = Float64(x - Float64(b * Float64(2.0 - Float64(y + t))))
	tmp = 0.0
	if (b <= -9.8e+39)
		tmp = t_2;
	elseif (b <= 6.6e+31)
		tmp = t_1;
	elseif (b <= 1.76e+87)
		tmp = Float64(Float64(b * Float64(Float64(y + t) - 2.0)) - Float64(t * a));
	elseif (b <= 4e+101)
		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 * (1.0 - y)) + (a * (1.0 - t)));
	t_2 = x - (b * (2.0 - (y + t)));
	tmp = 0.0;
	if (b <= -9.8e+39)
		tmp = t_2;
	elseif (b <= 6.6e+31)
		tmp = t_1;
	elseif (b <= 1.76e+87)
		tmp = (b * ((y + t) - 2.0)) - (t * a);
	elseif (b <= 4e+101)
		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[(N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(b * N[(2.0 - N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.8e+39], t$95$2, If[LessEqual[b, 6.6e+31], t$95$1, If[LessEqual[b, 1.76e+87], N[(N[(b * N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e+101], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 6.6 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 1.76 \cdot 10^{+87}:\\
\;\;\;\;b \cdot \left(\left(y + t\right) - 2\right) - t \cdot a\\

\mathbf{elif}\;b \leq 4 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -9.79999999999999974e39 or 3.9999999999999999e101 < b

    1. Initial program 89.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. Add Preprocessing
    3. Taylor expanded in a around 0 88.3%

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

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

    if -9.79999999999999974e39 < b < 6.59999999999999985e31 or 1.76000000000000003e87 < b < 3.9999999999999999e101

    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. Add Preprocessing
    3. Taylor expanded in b around 0 89.2%

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

    if 6.59999999999999985e31 < b < 1.76000000000000003e87

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.8 \cdot 10^{+39}:\\ \;\;\;\;x - b \cdot \left(2 - \left(y + t\right)\right)\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{+31}:\\ \;\;\;\;x + \left(z \cdot \left(1 - y\right) + a \cdot \left(1 - t\right)\right)\\ \mathbf{elif}\;b \leq 1.76 \cdot 10^{+87}:\\ \;\;\;\;b \cdot \left(\left(y + t\right) - 2\right) - t \cdot a\\ \mathbf{elif}\;b \leq 4 \cdot 10^{+101}:\\ \;\;\;\;x + \left(z \cdot \left(1 - y\right) + a \cdot \left(1 - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - b \cdot \left(2 - \left(y + t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 59.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot \left(1 - t\right)\\ t_2 := b \cdot \left(\left(y + t\right) - 2\right)\\ t_3 := z \cdot \left(1 - y\right)\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;b \leq -1.06 \cdot 10^{-250}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -1.5 \cdot 10^{-296}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{+32}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* a (- 1.0 t))))
        (t_2 (* b (- (+ y t) 2.0)))
        (t_3 (* z (- 1.0 y))))
   (if (<= b -1.3e+37)
     t_2
     (if (<= b -1.06e-250)
       t_1
       (if (<= b -1.5e-296)
         t_3
         (if (<= b 3e-50) t_1 (if (<= b 2.5e+32) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * (1.0 - t));
	double t_2 = b * ((y + t) - 2.0);
	double t_3 = z * (1.0 - y);
	double tmp;
	if (b <= -1.3e+37) {
		tmp = t_2;
	} else if (b <= -1.06e-250) {
		tmp = t_1;
	} else if (b <= -1.5e-296) {
		tmp = t_3;
	} else if (b <= 3e-50) {
		tmp = t_1;
	} else if (b <= 2.5e+32) {
		tmp = t_3;
	} 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 + (a * (1.0d0 - t))
    t_2 = b * ((y + t) - 2.0d0)
    t_3 = z * (1.0d0 - y)
    if (b <= (-1.3d+37)) then
        tmp = t_2
    else if (b <= (-1.06d-250)) then
        tmp = t_1
    else if (b <= (-1.5d-296)) then
        tmp = t_3
    else if (b <= 3d-50) then
        tmp = t_1
    else if (b <= 2.5d+32) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * (1.0 - t));
	double t_2 = b * ((y + t) - 2.0);
	double t_3 = z * (1.0 - y);
	double tmp;
	if (b <= -1.3e+37) {
		tmp = t_2;
	} else if (b <= -1.06e-250) {
		tmp = t_1;
	} else if (b <= -1.5e-296) {
		tmp = t_3;
	} else if (b <= 3e-50) {
		tmp = t_1;
	} else if (b <= 2.5e+32) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * (1.0 - t))
	t_2 = b * ((y + t) - 2.0)
	t_3 = z * (1.0 - y)
	tmp = 0
	if b <= -1.3e+37:
		tmp = t_2
	elif b <= -1.06e-250:
		tmp = t_1
	elif b <= -1.5e-296:
		tmp = t_3
	elif b <= 3e-50:
		tmp = t_1
	elif b <= 2.5e+32:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * Float64(1.0 - t)))
	t_2 = Float64(b * Float64(Float64(y + t) - 2.0))
	t_3 = Float64(z * Float64(1.0 - y))
	tmp = 0.0
	if (b <= -1.3e+37)
		tmp = t_2;
	elseif (b <= -1.06e-250)
		tmp = t_1;
	elseif (b <= -1.5e-296)
		tmp = t_3;
	elseif (b <= 3e-50)
		tmp = t_1;
	elseif (b <= 2.5e+32)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (a * (1.0 - t));
	t_2 = b * ((y + t) - 2.0);
	t_3 = z * (1.0 - y);
	tmp = 0.0;
	if (b <= -1.3e+37)
		tmp = t_2;
	elseif (b <= -1.06e-250)
		tmp = t_1;
	elseif (b <= -1.5e-296)
		tmp = t_3;
	elseif (b <= 3e-50)
		tmp = t_1;
	elseif (b <= 2.5e+32)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e+37], t$95$2, If[LessEqual[b, -1.06e-250], t$95$1, If[LessEqual[b, -1.5e-296], t$95$3, If[LessEqual[b, 3e-50], t$95$1, If[LessEqual[b, 2.5e+32], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -1.06 \cdot 10^{-250}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -1.5 \cdot 10^{-296}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;b \leq 3 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.5 \cdot 10^{+32}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.3e37 or 2.4999999999999999e32 < 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. Add Preprocessing
    3. Taylor expanded in b around inf 71.5%

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

    if -1.3e37 < b < -1.05999999999999993e-250 or -1.4999999999999999e-296 < b < 2.9999999999999999e-50

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

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

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

    if -1.05999999999999993e-250 < b < -1.4999999999999999e-296 or 2.9999999999999999e-50 < b < 2.4999999999999999e32

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in z around inf 60.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;b \cdot \left(\left(y + t\right) - 2\right)\\ \mathbf{elif}\;b \leq -1.06 \cdot 10^{-250}:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{elif}\;b \leq -1.5 \cdot 10^{-296}:\\ \;\;\;\;z \cdot \left(1 - y\right)\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-50}:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{+32}:\\ \;\;\;\;z \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(y + t\right) - 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 39.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(b - a\right)\\ \mathbf{if}\;t \leq -7.5 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-169}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-155}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{-30}:\\ \;\;\;\;a \cdot \left(1 - t\right)\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{+36}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* t (- b a))))
   (if (<= t -7.5e+34)
     t_1
     (if (<= t -1.22e-169)
       (* b y)
       (if (<= t 4.2e-155)
         x
         (if (<= t 8.8e-30)
           (* a (- 1.0 t))
           (if (<= t 5.3e+36) (* z (- y)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (b - a);
	double tmp;
	if (t <= -7.5e+34) {
		tmp = t_1;
	} else if (t <= -1.22e-169) {
		tmp = b * y;
	} else if (t <= 4.2e-155) {
		tmp = x;
	} else if (t <= 8.8e-30) {
		tmp = a * (1.0 - t);
	} else if (t <= 5.3e+36) {
		tmp = z * -y;
	} 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) :: tmp
    t_1 = t * (b - a)
    if (t <= (-7.5d+34)) then
        tmp = t_1
    else if (t <= (-1.22d-169)) then
        tmp = b * y
    else if (t <= 4.2d-155) then
        tmp = x
    else if (t <= 8.8d-30) then
        tmp = a * (1.0d0 - t)
    else if (t <= 5.3d+36) then
        tmp = z * -y
    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 = t * (b - a);
	double tmp;
	if (t <= -7.5e+34) {
		tmp = t_1;
	} else if (t <= -1.22e-169) {
		tmp = b * y;
	} else if (t <= 4.2e-155) {
		tmp = x;
	} else if (t <= 8.8e-30) {
		tmp = a * (1.0 - t);
	} else if (t <= 5.3e+36) {
		tmp = z * -y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = t * (b - a)
	tmp = 0
	if t <= -7.5e+34:
		tmp = t_1
	elif t <= -1.22e-169:
		tmp = b * y
	elif t <= 4.2e-155:
		tmp = x
	elif t <= 8.8e-30:
		tmp = a * (1.0 - t)
	elif t <= 5.3e+36:
		tmp = z * -y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(t * Float64(b - a))
	tmp = 0.0
	if (t <= -7.5e+34)
		tmp = t_1;
	elseif (t <= -1.22e-169)
		tmp = Float64(b * y);
	elseif (t <= 4.2e-155)
		tmp = x;
	elseif (t <= 8.8e-30)
		tmp = Float64(a * Float64(1.0 - t));
	elseif (t <= 5.3e+36)
		tmp = Float64(z * Float64(-y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = t * (b - a);
	tmp = 0.0;
	if (t <= -7.5e+34)
		tmp = t_1;
	elseif (t <= -1.22e-169)
		tmp = b * y;
	elseif (t <= 4.2e-155)
		tmp = x;
	elseif (t <= 8.8e-30)
		tmp = a * (1.0 - t);
	elseif (t <= 5.3e+36)
		tmp = z * -y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e+34], t$95$1, If[LessEqual[t, -1.22e-169], N[(b * y), $MachinePrecision], If[LessEqual[t, 4.2e-155], x, If[LessEqual[t, 8.8e-30], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.3e+36], N[(z * (-y)), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.22 \cdot 10^{-169}:\\
\;\;\;\;b \cdot y\\

\mathbf{elif}\;t \leq 4.2 \cdot 10^{-155}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 8.8 \cdot 10^{-30}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\

\mathbf{elif}\;t \leq 5.3 \cdot 10^{+36}:\\
\;\;\;\;z \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -7.49999999999999976e34 or 5.3e36 < t

    1. Initial program 94.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. Add Preprocessing
    3. Taylor expanded in t around inf 68.1%

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

    if -7.49999999999999976e34 < t < -1.22e-169

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

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

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

    if -1.22e-169 < t < 4.2000000000000003e-155

    1. Initial program 96.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. Add Preprocessing
    3. Taylor expanded in x around inf 37.2%

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

    if 4.2000000000000003e-155 < t < 8.79999999999999933e-30

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

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

    if 8.79999999999999933e-30 < t < 5.3e36

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

      \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
    4. Taylor expanded in y around inf 46.4%

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

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

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

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

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

Alternative 8: 86.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;b \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;x + \left(z \cdot \left(1 - y\right) + t\_1\right)\\

\mathbf{elif}\;b \leq 10^{+123}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.02000000000000007e-39 or 4.2e30 < b < 9.99999999999999978e122

    1. Initial program 96.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. Add Preprocessing
    3. Taylor expanded in z around 0 84.3%

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

    if -1.02000000000000007e-39 < b < 4.2e30

    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. Add Preprocessing
    3. Taylor expanded in b around 0 91.7%

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

    if 9.99999999999999978e122 < b

    1. Initial program 86.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. Add Preprocessing
    3. Taylor expanded in a around 0 92.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.02 \cdot 10^{-39}:\\ \;\;\;\;\left(x - b \cdot \left(2 - \left(y + t\right)\right)\right) + a \cdot \left(1 - t\right)\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+30}:\\ \;\;\;\;x + \left(z \cdot \left(1 - y\right) + a \cdot \left(1 - t\right)\right)\\ \mathbf{elif}\;b \leq 10^{+123}:\\ \;\;\;\;\left(x - b \cdot \left(2 - \left(y + t\right)\right)\right) + a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;x - b \cdot \left(2 - \left(y + t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 25.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+128}:\\ \;\;\;\;b \cdot t\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{+35}:\\ \;\;\;\;t \cdot \left(-a\right)\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-178}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+173}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -2.6e+128)
   (* b t)
   (if (<= t -1.4e+35)
     (* t (- a))
     (if (<= t -3.1e-178)
       (* b y)
       (if (<= t 5.2e-145) x (if (<= t 5.8e+173) (* z (- y)) (* b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -2.6e+128) {
		tmp = b * t;
	} else if (t <= -1.4e+35) {
		tmp = t * -a;
	} else if (t <= -3.1e-178) {
		tmp = b * y;
	} else if (t <= 5.2e-145) {
		tmp = x;
	} else if (t <= 5.8e+173) {
		tmp = z * -y;
	} else {
		tmp = b * t;
	}
	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 <= (-2.6d+128)) then
        tmp = b * t
    else if (t <= (-1.4d+35)) then
        tmp = t * -a
    else if (t <= (-3.1d-178)) then
        tmp = b * y
    else if (t <= 5.2d-145) then
        tmp = x
    else if (t <= 5.8d+173) then
        tmp = z * -y
    else
        tmp = b * t
    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 <= -2.6e+128) {
		tmp = b * t;
	} else if (t <= -1.4e+35) {
		tmp = t * -a;
	} else if (t <= -3.1e-178) {
		tmp = b * y;
	} else if (t <= 5.2e-145) {
		tmp = x;
	} else if (t <= 5.8e+173) {
		tmp = z * -y;
	} else {
		tmp = b * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -2.6e+128:
		tmp = b * t
	elif t <= -1.4e+35:
		tmp = t * -a
	elif t <= -3.1e-178:
		tmp = b * y
	elif t <= 5.2e-145:
		tmp = x
	elif t <= 5.8e+173:
		tmp = z * -y
	else:
		tmp = b * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -2.6e+128)
		tmp = Float64(b * t);
	elseif (t <= -1.4e+35)
		tmp = Float64(t * Float64(-a));
	elseif (t <= -3.1e-178)
		tmp = Float64(b * y);
	elseif (t <= 5.2e-145)
		tmp = x;
	elseif (t <= 5.8e+173)
		tmp = Float64(z * Float64(-y));
	else
		tmp = Float64(b * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -2.6e+128)
		tmp = b * t;
	elseif (t <= -1.4e+35)
		tmp = t * -a;
	elseif (t <= -3.1e-178)
		tmp = b * y;
	elseif (t <= 5.2e-145)
		tmp = x;
	elseif (t <= 5.8e+173)
		tmp = z * -y;
	else
		tmp = b * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.6e+128], N[(b * t), $MachinePrecision], If[LessEqual[t, -1.4e+35], N[(t * (-a)), $MachinePrecision], If[LessEqual[t, -3.1e-178], N[(b * y), $MachinePrecision], If[LessEqual[t, 5.2e-145], x, If[LessEqual[t, 5.8e+173], N[(z * (-y)), $MachinePrecision], N[(b * t), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.4 \cdot 10^{+35}:\\
\;\;\;\;t \cdot \left(-a\right)\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-178}:\\
\;\;\;\;b \cdot y\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-145}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 5.8 \cdot 10^{+173}:\\
\;\;\;\;z \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -2.6e128 or 5.80000000000000014e173 < t

    1. Initial program 89.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. Add Preprocessing
    3. Taylor expanded in t around inf 81.0%

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
    4. Taylor expanded in b around inf 57.7%

      \[\leadsto \color{blue}{b \cdot t} \]
    5. Step-by-step derivation
      1. *-commutative57.7%

        \[\leadsto \color{blue}{t \cdot b} \]
    6. Simplified57.7%

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

    if -2.6e128 < t < -1.39999999999999999e35

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(-t\right)} + \left(\left(y + t\right) - 2\right) \cdot b \]
    5. Simplified55.2%

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

      \[\leadsto a \cdot \left(-t\right) + \color{blue}{b \cdot t} \]
    7. Taylor expanded in a around inf 30.6%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot t\right)} \]
    8. Step-by-step derivation
      1. associate-*r*30.6%

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot t} \]
      2. mul-1-neg30.6%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot t \]
    9. Simplified30.6%

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

    if -1.39999999999999999e35 < t < -3.1e-178

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

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

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

    if -3.1e-178 < t < 5.1999999999999999e-145

    1. Initial program 96.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. Add Preprocessing
    3. Taylor expanded in x around inf 37.8%

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

    if 5.1999999999999999e-145 < t < 5.80000000000000014e173

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

      \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
    4. Taylor expanded in y around inf 29.0%

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]
    6. Simplified29.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+128}:\\ \;\;\;\;b \cdot t\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{+35}:\\ \;\;\;\;t \cdot \left(-a\right)\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-178}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+173}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 65.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+47}:\\
\;\;\;\;y \cdot \left(b - z\right)\\

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

\mathbf{elif}\;y \leq 20000:\\
\;\;\;\;x + a \cdot \left(1 - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.79999999999999961e47

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

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

    if -5.79999999999999961e47 < y < 8.4999999999999995e-116

    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. Add Preprocessing
    3. Taylor expanded in a around 0 74.1%

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

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

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

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

        \[\leadsto x + \left(b \cdot \left(t + \color{blue}{-2}\right) - -1 \cdot z\right) \]
      4. neg-mul-172.8%

        \[\leadsto x + \left(b \cdot \left(t + -2\right) - \color{blue}{\left(-z\right)}\right) \]
    6. Simplified72.8%

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

    if 8.4999999999999995e-116 < y < 2e4

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

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

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

    if 2e4 < y

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-116}:\\ \;\;\;\;x + \left(z + b \cdot \left(t + -2\right)\right)\\ \mathbf{elif}\;y \leq 20000:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(y + t\right) - 2\right) - y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 85.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;b \leq 5.6 \cdot 10^{-53}:\\
\;\;\;\;x + \left(t\_3 + t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.05000000000000009e-40

    1. Initial program 94.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. Add Preprocessing
    3. Taylor expanded in z around 0 85.2%

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

    if -1.05000000000000009e-40 < b < 5.59999999999999971e-53

    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. Add Preprocessing
    3. Taylor expanded in b around 0 94.7%

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

    if 5.59999999999999971e-53 < b

    1. Initial program 93.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. Add Preprocessing
    3. Taylor expanded in a around 0 86.4%

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

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

Alternative 12: 64.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(b - z\right)\\ \mathbf{if}\;y \leq -8.5 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.1 \cdot 10^{-116}:\\ \;\;\;\;x + \left(z + b \cdot \left(t + -2\right)\right)\\ \mathbf{elif}\;y \leq 65000:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (- b z))))
   (if (<= y -8.5e+43)
     t_1
     (if (<= y 8.1e-116)
       (+ x (+ z (* b (+ t -2.0))))
       (if (<= y 65000.0) (+ x (* a (- 1.0 t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (b - z);
	double tmp;
	if (y <= -8.5e+43) {
		tmp = t_1;
	} else if (y <= 8.1e-116) {
		tmp = x + (z + (b * (t + -2.0)));
	} else if (y <= 65000.0) {
		tmp = x + (a * (1.0 - t));
	} 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) :: tmp
    t_1 = y * (b - z)
    if (y <= (-8.5d+43)) then
        tmp = t_1
    else if (y <= 8.1d-116) then
        tmp = x + (z + (b * (t + (-2.0d0))))
    else if (y <= 65000.0d0) then
        tmp = x + (a * (1.0d0 - t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (b - z);
	double tmp;
	if (y <= -8.5e+43) {
		tmp = t_1;
	} else if (y <= 8.1e-116) {
		tmp = x + (z + (b * (t + -2.0)));
	} else if (y <= 65000.0) {
		tmp = x + (a * (1.0 - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (b - z)
	tmp = 0
	if y <= -8.5e+43:
		tmp = t_1
	elif y <= 8.1e-116:
		tmp = x + (z + (b * (t + -2.0)))
	elif y <= 65000.0:
		tmp = x + (a * (1.0 - t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(b - z))
	tmp = 0.0
	if (y <= -8.5e+43)
		tmp = t_1;
	elseif (y <= 8.1e-116)
		tmp = Float64(x + Float64(z + Float64(b * Float64(t + -2.0))));
	elseif (y <= 65000.0)
		tmp = Float64(x + Float64(a * Float64(1.0 - t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (b - z);
	tmp = 0.0;
	if (y <= -8.5e+43)
		tmp = t_1;
	elseif (y <= 8.1e-116)
		tmp = x + (z + (b * (t + -2.0)));
	elseif (y <= 65000.0)
		tmp = x + (a * (1.0 - t));
	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]}, If[LessEqual[y, -8.5e+43], t$95$1, If[LessEqual[y, 8.1e-116], N[(x + N[(z + N[(b * N[(t + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 65000.0], N[(x + N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 65000:\\
\;\;\;\;x + a \cdot \left(1 - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.5e43 or 65000 < y

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

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

    if -8.5e43 < y < 8.1e-116

    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. Add Preprocessing
    3. Taylor expanded in a around 0 74.1%

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

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

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

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

        \[\leadsto x + \left(b \cdot \left(t + \color{blue}{-2}\right) - -1 \cdot z\right) \]
      4. neg-mul-172.8%

        \[\leadsto x + \left(b \cdot \left(t + -2\right) - \color{blue}{\left(-z\right)}\right) \]
    6. Simplified72.8%

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

    if 8.1e-116 < y < 65000

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+43}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \mathbf{elif}\;y \leq 8.1 \cdot 10^{-116}:\\ \;\;\;\;x + \left(z + b \cdot \left(t + -2\right)\right)\\ \mathbf{elif}\;y \leq 65000:\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(b - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 24.5% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-145}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 6 \cdot 10^{+173}:\\
\;\;\;\;z \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.29999999999999978e79 or 5.9999999999999995e173 < t

    1. Initial program 91.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. Add Preprocessing
    3. Taylor expanded in t around inf 75.8%

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
    4. Taylor expanded in b around inf 51.7%

      \[\leadsto \color{blue}{b \cdot t} \]
    5. Step-by-step derivation
      1. *-commutative51.7%

        \[\leadsto \color{blue}{t \cdot b} \]
    6. Simplified51.7%

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

    if -5.29999999999999978e79 < t < 4.60000000000000014e-145

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

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

    if 4.60000000000000014e-145 < t < 5.9999999999999995e173

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

      \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
    4. Taylor expanded in y around inf 29.0%

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]
    6. Simplified29.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{+79}:\\ \;\;\;\;b \cdot t\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+173}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 51.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+44} \lor \neg \left(y \leq 9600000000000\right):\\
\;\;\;\;y \cdot \left(b - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.6000000000000002e44 or 9.6e12 < y

    1. Initial program 93.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. Add Preprocessing
    3. Taylor expanded in y around inf 70.0%

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

    if -5.6000000000000002e44 < y < 9.6e12

    1. Initial program 97.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. Add Preprocessing
    3. Taylor expanded in t around inf 44.3%

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

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

Alternative 15: 24.9% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+80} \lor \neg \left(t \leq 3.5 \cdot 10^{+40}\right):\\
\;\;\;\;b \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.29999999999999991e80 or 3.4999999999999999e40 < t

    1. Initial program 93.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. Add Preprocessing
    3. Taylor expanded in t around inf 72.0%

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
    4. Taylor expanded in b around inf 44.0%

      \[\leadsto \color{blue}{b \cdot t} \]
    5. Step-by-step derivation
      1. *-commutative44.0%

        \[\leadsto \color{blue}{t \cdot b} \]
    6. Simplified44.0%

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

    if -3.29999999999999991e80 < t < 3.4999999999999999e40

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{+80} \lor \neg \left(t \leq 3.5 \cdot 10^{+40}\right):\\ \;\;\;\;b \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 26.1% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+40} \lor \neg \left(b \leq 0.00045\right):\\
\;\;\;\;b \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.0000000000000002e40 or 4.4999999999999999e-4 < b

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

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

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

    if -3.0000000000000002e40 < b < 4.4999999999999999e-4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{+40} \lor \neg \left(b \leq 0.00045\right):\\ \;\;\;\;b \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 20.6% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-47}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.00000000000000007e70 or 2.29999999999999982e-47 < x

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in x around inf 30.7%

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

    if -1.00000000000000007e70 < x < 2.29999999999999982e-47

    1. Initial program 93.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. Add Preprocessing
    3. Taylor expanded in z around inf 33.0%

      \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
    4. Taylor expanded in y around 0 15.7%

      \[\leadsto \color{blue}{z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 15.8% accurate, 21.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 96.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. Add Preprocessing
  3. Taylor expanded in x around inf 16.6%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Reproduce

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