AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1

Percentage Accurate: 60.6% → 87.9%
Time: 15.5s
Alternatives: 13
Speedup: 1.1×

Specification

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

\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\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 13 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: 60.6% accurate, 1.0× speedup?

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

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

Alternative 1: 87.9% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;z + a \cdot \frac{y + t}{t\_1}\\

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


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

    1. Initial program 10.9%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 81.6%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -1.99999999999999992e275 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e299

    1. Initial program 99.6%

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

    if 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < +inf.0

    1. Initial program 5.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 5.8%

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

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

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

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

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

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+39.6%

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

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+39.6%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg39.6%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub39.6%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}} \]
    5. Simplified39.0%

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

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

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

Alternative 2: 72.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1} + x \cdot \frac{z}{x + t}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+191}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;y \leq -6.4 \cdot 10^{+76}:\\
\;\;\;\;\frac{x \cdot z}{t\_1} + y \cdot \frac{z - b}{t\_1}\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.40000000000000009e191 or 1.15e31 < y

    1. Initial program 40.0%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 81.7%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -3.40000000000000009e191 < y < -1.19999999999999994e109 or -6.39999999999999953e76 < y < 1.15e31

    1. Initial program 73.2%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 73.2%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative84.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+84.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative84.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+84.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg84.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub84.7%

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

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

      \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{x \cdot z}{t + x}} \]
    7. Step-by-step derivation
      1. associate-/l*77.0%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{x \cdot \frac{z}{t + x}} \]
    8. Simplified77.0%

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

    if -1.19999999999999994e109 < y < -6.39999999999999953e76

    1. Initial program 52.3%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in a around -inf 42.7%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot z}{t + \left(x + y\right)} + \frac{y \cdot \left(z - b\right)}{t + \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. associate-+r+44.3%

        \[\leadsto \frac{x \cdot z}{\color{blue}{\left(t + x\right) + y}} + \frac{y \cdot \left(z - b\right)}{t + \left(x + y\right)} \]
      2. +-commutative44.3%

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

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \color{blue}{y \cdot \frac{z - b}{t + \left(x + y\right)}} \]
      4. associate-+r+89.8%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + y \cdot \frac{z - b}{\color{blue}{\left(t + x\right) + y}} \]
      5. +-commutative89.8%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + y \cdot \frac{z - b}{\color{blue}{y + \left(t + x\right)}} \]
    7. Simplified89.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+191}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{+109}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)} + x \cdot \frac{z}{x + t}\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{+76}:\\ \;\;\;\;\frac{x \cdot z}{y + \left(x + t\right)} + y \cdot \frac{z - b}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+31}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)} + x \cdot \frac{z}{x + t}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 70.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+43} \lor \neg \left(b \leq 2.2 \cdot 10^{+174}\right):\\
\;\;\;\;\frac{x \cdot z}{t\_1} + \frac{y}{t\_1} \cdot \left(z - b\right)\\

\mathbf{else}:\\
\;\;\;\;z + a \cdot \frac{y + t}{t\_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.40000000000000023e43 or 2.2000000000000002e174 < b

    1. Initial program 45.9%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in a around -inf 49.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot z}{t + \left(x + y\right)} + \frac{y \cdot \left(z - b\right)}{t + \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. associate-+r+38.4%

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

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

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \color{blue}{y \cdot \frac{z - b}{t + \left(x + y\right)}} \]
      4. associate-+r+64.6%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + y \cdot \frac{z - b}{\color{blue}{\left(t + x\right) + y}} \]
      5. +-commutative64.6%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + y \cdot \frac{z - b}{\color{blue}{y + \left(t + x\right)}} \]
    7. Simplified64.6%

      \[\leadsto \color{blue}{\frac{x \cdot z}{y + \left(t + x\right)} + y \cdot \frac{z - b}{y + \left(t + x\right)}} \]
    8. Step-by-step derivation
      1. clear-num64.4%

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

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \color{blue}{\frac{y}{\frac{y + \left(t + x\right)}{z - b}}} \]
      3. +-commutative65.6%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \frac{y}{\frac{\color{blue}{\left(t + x\right) + y}}{z - b}} \]
      4. +-commutative65.6%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \frac{y}{\frac{\color{blue}{\left(x + t\right)} + y}{z - b}} \]
      5. associate-+l+65.6%

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

      \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \color{blue}{\frac{y}{\frac{x + \left(t + y\right)}{z - b}}} \]
    10. Step-by-step derivation
      1. associate-/r/69.2%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \color{blue}{\frac{y}{x + \left(t + y\right)} \cdot \left(z - b\right)} \]
      2. associate-+r+69.2%

        \[\leadsto \frac{x \cdot z}{y + \left(t + x\right)} + \frac{y}{\color{blue}{\left(x + t\right) + y}} \cdot \left(z - b\right) \]
    11. Simplified69.2%

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

    if -2.40000000000000023e43 < b < 2.2000000000000002e174

    1. Initial program 65.3%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 65.4%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative77.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+77.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative77.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+77.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg77.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub77.7%

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

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

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

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

Alternative 4: 58.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -4 \cdot 10^{-36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-259}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-305}:\\ \;\;\;\;x \cdot \frac{z}{x + t}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-61}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b)))
   (if (<= y -4e-36)
     t_1
     (if (<= y -4.8e-259)
       (+ z a)
       (if (<= y -7.2e-305)
         (* x (/ z (+ x t)))
         (if (<= y 9.2e-61) (+ z a) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double tmp;
	if (y <= -4e-36) {
		tmp = t_1;
	} else if (y <= -4.8e-259) {
		tmp = z + a;
	} else if (y <= -7.2e-305) {
		tmp = x * (z / (x + t));
	} else if (y <= 9.2e-61) {
		tmp = z + a;
	} 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 = (z + a) - b
    if (y <= (-4d-36)) then
        tmp = t_1
    else if (y <= (-4.8d-259)) then
        tmp = z + a
    else if (y <= (-7.2d-305)) then
        tmp = x * (z / (x + t))
    else if (y <= 9.2d-61) then
        tmp = z + a
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double tmp;
	if (y <= -4e-36) {
		tmp = t_1;
	} else if (y <= -4.8e-259) {
		tmp = z + a;
	} else if (y <= -7.2e-305) {
		tmp = x * (z / (x + t));
	} else if (y <= 9.2e-61) {
		tmp = z + a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	tmp = 0
	if y <= -4e-36:
		tmp = t_1
	elif y <= -4.8e-259:
		tmp = z + a
	elif y <= -7.2e-305:
		tmp = x * (z / (x + t))
	elif y <= 9.2e-61:
		tmp = z + a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	tmp = 0.0
	if (y <= -4e-36)
		tmp = t_1;
	elseif (y <= -4.8e-259)
		tmp = Float64(z + a);
	elseif (y <= -7.2e-305)
		tmp = Float64(x * Float64(z / Float64(x + t)));
	elseif (y <= 9.2e-61)
		tmp = Float64(z + a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	tmp = 0.0;
	if (y <= -4e-36)
		tmp = t_1;
	elseif (y <= -4.8e-259)
		tmp = z + a;
	elseif (y <= -7.2e-305)
		tmp = x * (z / (x + t));
	elseif (y <= 9.2e-61)
		tmp = z + a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -4e-36], t$95$1, If[LessEqual[y, -4.8e-259], N[(z + a), $MachinePrecision], If[LessEqual[y, -7.2e-305], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-61], N[(z + a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-259}:\\
\;\;\;\;z + a\\

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

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-61}:\\
\;\;\;\;z + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.9999999999999998e-36 or 9.19999999999999967e-61 < y

    1. Initial program 47.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -3.9999999999999998e-36 < y < -4.8000000000000001e-259 or -7.20000000000000007e-305 < y < 9.19999999999999967e-61

    1. Initial program 77.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 77.5%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative90.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+90.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative90.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+90.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg90.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub90.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}} \]
    5. Simplified90.7%

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

      \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{z} \]
    7. Taylor expanded in t around inf 54.8%

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

    if -4.8000000000000001e-259 < y < -7.20000000000000007e-305

    1. Initial program 82.0%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 75.9%

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Taylor expanded in a around 0 57.9%

      \[\leadsto \color{blue}{\frac{x \cdot z}{t + x}} \]
    5. Step-by-step derivation
      1. associate-/l*70.1%

        \[\leadsto \color{blue}{x \cdot \frac{z}{t + x}} \]
      2. +-commutative70.1%

        \[\leadsto x \cdot \frac{z}{\color{blue}{x + t}} \]
    6. Simplified70.1%

      \[\leadsto \color{blue}{x \cdot \frac{z}{x + t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-36}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-259}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-305}:\\ \;\;\;\;x \cdot \frac{z}{x + t}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-61}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+62} \lor \neg \left(x \leq 2.85 \cdot 10^{-41}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{y + \left(x + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5000000000000003e62 or 2.85000000000000023e-41 < x

    1. Initial program 52.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 52.6%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative61.9%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+61.9%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative61.9%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+61.9%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg61.9%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub61.9%

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

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

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

    if -9.5000000000000003e62 < x < 2.85000000000000023e-41

    1. Initial program 67.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in a around -inf 75.4%

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

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

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{y \cdot \left(z - b\right)}{a \cdot \left(t + y\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-/l*71.3%

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

        \[\leadsto a \cdot \left(1 + y \cdot \frac{z - b}{\color{blue}{\left(t + y\right) \cdot a}}\right) \]
      3. +-commutative71.3%

        \[\leadsto a \cdot \left(1 + y \cdot \frac{z - b}{\color{blue}{\left(y + t\right)} \cdot a}\right) \]
    7. Simplified71.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{+62} \lor \neg \left(x \leq 2.85 \cdot 10^{-41}\right):\\ \;\;\;\;z + a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(1 + y \cdot \frac{z - b}{\left(y + t\right) \cdot a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.3 \cdot 10^{+63} \lor \neg \left(x \leq 4.5 \cdot 10^{-149}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{y + \left(x + t\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.2999999999999999e63 or 4.4999999999999998e-149 < x

    1. Initial program 56.3%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 56.3%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative66.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+66.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative66.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+66.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg66.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub66.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}} \]
    5. Simplified66.4%

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

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

    if -5.2999999999999999e63 < x < 4.4999999999999998e-149

    1. Initial program 65.3%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 71.0%

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

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

Alternative 7: 61.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.22 \cdot 10^{+120}:\\ \;\;\;\;z + a \cdot \frac{y + t}{x}\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+199}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -1.22e+120)
   (+ z (* a (/ (+ y t) x)))
   (if (<= x 7e+199) (- (+ z a) b) (+ z (* y (- (/ a x) (/ b x)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.22e+120) {
		tmp = z + (a * ((y + t) / x));
	} else if (x <= 7e+199) {
		tmp = (z + a) - b;
	} else {
		tmp = z + (y * ((a / x) - (b / x)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= (-1.22d+120)) then
        tmp = z + (a * ((y + t) / x))
    else if (x <= 7d+199) then
        tmp = (z + a) - b
    else
        tmp = z + (y * ((a / x) - (b / x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.22e+120) {
		tmp = z + (a * ((y + t) / x));
	} else if (x <= 7e+199) {
		tmp = (z + a) - b;
	} else {
		tmp = z + (y * ((a / x) - (b / x)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -1.22e+120:
		tmp = z + (a * ((y + t) / x))
	elif x <= 7e+199:
		tmp = (z + a) - b
	else:
		tmp = z + (y * ((a / x) - (b / x)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -1.22e+120)
		tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x)));
	elseif (x <= 7e+199)
		tmp = Float64(Float64(z + a) - b);
	else
		tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -1.22e+120)
		tmp = z + (a * ((y + t) / x));
	elseif (x <= 7e+199)
		tmp = (z + a) - b;
	else
		tmp = z + (y * ((a / x) - (b / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.22e+120], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+199], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{+120}:\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\

\mathbf{elif}\;x \leq 7 \cdot 10^{+199}:\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.22e120

    1. Initial program 45.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 45.7%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative49.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+49.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative49.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+49.7%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg49.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub49.7%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}} \]
    5. Simplified49.0%

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

      \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{z} \]
    7. Taylor expanded in x around inf 66.3%

      \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{x}} + z \]
    8. Step-by-step derivation
      1. associate-/l*72.9%

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{x}} + z \]
      2. +-commutative72.9%

        \[\leadsto a \cdot \frac{\color{blue}{y + t}}{x} + z \]
    9. Simplified72.9%

      \[\leadsto \color{blue}{a \cdot \frac{y + t}{x}} + z \]

    if -1.22e120 < x < 6.99999999999999962e199

    1. Initial program 64.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 66.2%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if 6.99999999999999962e199 < x

    1. Initial program 45.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 40.2%

      \[\leadsto \color{blue}{\frac{\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y}{x + y}} \]
    4. Taylor expanded in y around 0 83.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.22 \cdot 10^{+120}:\\ \;\;\;\;z + a \cdot \frac{y + t}{x}\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+199}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 61.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+119} \lor \neg \left(x \leq 1.6 \cdot 10^{+195}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\

\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.2000000000000003e119 or 1.59999999999999991e195 < x

    1. Initial program 45.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 45.1%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      5. +-commutative48.3%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+48.3%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      7. +-commutative48.3%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+48.3%

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      9. sub-neg48.3%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      10. div-sub48.3%

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}} \]
    5. Simplified47.8%

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

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

      \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{x}} + z \]
    8. Step-by-step derivation
      1. associate-/l*75.6%

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{x}} + z \]
      2. +-commutative75.6%

        \[\leadsto a \cdot \frac{\color{blue}{y + t}}{x} + z \]
    9. Simplified75.6%

      \[\leadsto \color{blue}{a \cdot \frac{y + t}{x}} + z \]

    if -9.2000000000000003e119 < x < 1.59999999999999991e195

    1. Initial program 64.9%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 66.5%

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

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

Alternative 9: 59.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-36} \lor \neg \left(y \leq 1.04 \cdot 10^{-54}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.75e-36 or 1.04e-54 < y

    1. Initial program 47.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]

    if -1.75e-36 < y < 1.04e-54

    1. Initial program 78.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 78.2%

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

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

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

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

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

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+89.1%

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

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+89.1%

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

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

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

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

      \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{z} \]
    7. Taylor expanded in t around inf 52.8%

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

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

Alternative 10: 52.1% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-26} \lor \neg \left(z \leq 8.8 \cdot 10^{-113}\right):\\
\;\;\;\;z + a\\

\mathbf{else}:\\
\;\;\;\;a - b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.4999999999999994e-26 or 8.80000000000000016e-113 < z

    1. Initial program 50.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0 50.6%

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

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

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

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

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

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      6. associate-+r+60.2%

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

        \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
      8. associate-+l+60.2%

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

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

        \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}} \]
    5. Simplified60.0%

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

      \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{z} \]
    7. Taylor expanded in t around inf 59.6%

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

    if -7.4999999999999994e-26 < z < 8.80000000000000016e-113

    1. Initial program 72.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 62.3%

      \[\leadsto \frac{\color{blue}{a \cdot \left(t + y\right) - b \cdot y}}{\left(x + t\right) + y} \]
    4. Step-by-step derivation
      1. *-commutative62.3%

        \[\leadsto \frac{a \cdot \left(t + y\right) - \color{blue}{y \cdot b}}{\left(x + t\right) + y} \]
    5. Simplified62.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{-26} \lor \neg \left(z \leq 8.8 \cdot 10^{-113}\right):\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;a - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 45.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.65 \cdot 10^{+41}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -2.65e+41) a (if (<= t 2.55e-21) z a)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -2.65e+41) {
		tmp = a;
	} else if (t <= 2.55e-21) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-2.65d+41)) then
        tmp = a
    else if (t <= 2.55d-21) then
        tmp = z
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -2.65e+41) {
		tmp = a;
	} else if (t <= 2.55e-21) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -2.65e+41:
		tmp = a
	elif t <= 2.55e-21:
		tmp = z
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -2.65e+41)
		tmp = a;
	elseif (t <= 2.55e-21)
		tmp = z;
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -2.65e+41)
		tmp = a;
	elseif (t <= 2.55e-21)
		tmp = z;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.65e+41], a, If[LessEqual[t, 2.55e-21], z, a]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.65 \cdot 10^{+41}:\\
\;\;\;\;a\\

\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.6499999999999998e41 or 2.55000000000000002e-21 < t

    1. Initial program 48.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 52.6%

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

    if -2.6499999999999998e41 < t < 2.55000000000000002e-21

    1. Initial program 68.4%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 47.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.65 \cdot 10^{+41}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 51.3% accurate, 7.0× speedup?

\[\begin{array}{l} \\ z + a \end{array} \]
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
	return z + a;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return z + a;
}
def code(x, y, z, t, a, b):
	return z + a
function code(x, y, z, t, a, b)
	return Float64(z + a)
end
function tmp = code(x, y, z, t, a, b)
	tmp = z + a;
end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}

\\
z + a
\end{array}
Derivation
  1. Initial program 59.8%

    \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
  2. Add Preprocessing
  3. Taylor expanded in b around 0 59.8%

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
    5. +-commutative70.7%

      \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(x + y\right) + t}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
    6. associate-+r+70.7%

      \[\leadsto a \cdot \frac{t + y}{\color{blue}{x + \left(y + t\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
    7. +-commutative70.7%

      \[\leadsto a \cdot \frac{t + y}{\color{blue}{\left(y + t\right) + x}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
    8. associate-+l+70.7%

      \[\leadsto a \cdot \frac{t + y}{\color{blue}{y + \left(t + x\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(-\frac{b \cdot y}{t + \left(x + y\right)}\right)\right) \]
    9. sub-neg70.7%

      \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
    10. div-sub70.6%

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

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

    \[\leadsto a \cdot \frac{t + y}{y + \left(t + x\right)} + \color{blue}{z} \]
  7. Taylor expanded in t around inf 53.1%

    \[\leadsto \color{blue}{a} + z \]
  8. Final simplification53.1%

    \[\leadsto z + a \]
  9. Add Preprocessing

Alternative 13: 32.7% accurate, 21.0× speedup?

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

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

    \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
  2. Add Preprocessing
  3. Taylor expanded in t around inf 31.4%

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

    \[\leadsto a \]
  5. Add Preprocessing

Developer target: 81.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024059 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

  :alt
  (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))

  (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))