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

Percentage Accurate: 61.0% → 87.4%
Time: 12.1s
Alternatives: 12
Speedup: 1.0×

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 12 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: 61.0% 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.4% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 8.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

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6468.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified68.9%

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

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

    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
  3. Recombined 2 regimes into one program.
  4. Final simplification86.7%

    \[\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 -\infty:\\ \;\;\;\;\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 4 \cdot 10^{+248}:\\ \;\;\;\;\frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 64.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-140}:\\ \;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\ \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 -1.7e-39)
     t_1
     (if (<= y -3.3e-140)
       (* b (- (/ z b) (/ y (+ (+ x y) t))))
       (if (<= y 7.8e-91)
         (/ (+ (* (+ x y) z) (* (+ y t) a)) (+ y (+ x t)))
         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 <= -1.7e-39) {
		tmp = t_1;
	} else if (y <= -3.3e-140) {
		tmp = b * ((z / b) - (y / ((x + y) + t)));
	} else if (y <= 7.8e-91) {
		tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + a) - b
    if (y <= (-1.7d-39)) then
        tmp = t_1
    else if (y <= (-3.3d-140)) then
        tmp = b * ((z / b) - (y / ((x + y) + t)))
    else if (y <= 7.8d-91) then
        tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double tmp;
	if (y <= -1.7e-39) {
		tmp = t_1;
	} else if (y <= -3.3e-140) {
		tmp = b * ((z / b) - (y / ((x + y) + t)));
	} else if (y <= 7.8e-91) {
		tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	tmp = 0
	if y <= -1.7e-39:
		tmp = t_1
	elif y <= -3.3e-140:
		tmp = b * ((z / b) - (y / ((x + y) + t)))
	elif y <= 7.8e-91:
		tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t))
	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 <= -1.7e-39)
		tmp = t_1;
	elseif (y <= -3.3e-140)
		tmp = Float64(b * Float64(Float64(z / b) - Float64(y / Float64(Float64(x + y) + t))));
	elseif (y <= 7.8e-91)
		tmp = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) / Float64(y + Float64(x + t)));
	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 <= -1.7e-39)
		tmp = t_1;
	elseif (y <= -3.3e-140)
		tmp = b * ((z / b) - (y / ((x + y) + t)));
	elseif (y <= 7.8e-91)
		tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t));
	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, -1.7e-39], t$95$1, If[LessEqual[y, -3.3e-140], N[(b * N[(N[(z / b), $MachinePrecision] - N[(y / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-91], N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.3 \cdot 10^{-140}:\\
\;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7e-39 or 7.79999999999999987e-91 < y

    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 y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6468.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified68.4%

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

    if -1.7e-39 < y < -3.29999999999999987e-140

    1. Initial program 75.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 z around -inf

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

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)\right)\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \color{blue}{\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}}\right)\right)\right) \]
    5. Simplified87.1%

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

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(a \cdot \left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(\left(-1 \cdot a\right) \cdot \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(-1 \cdot a\right), \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      5. distribute-lft-out--N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(-1 \cdot \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \mathsf{\_.f64}\left(\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}\right), \color{blue}{\left(\frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right)\right) \]
    8. Simplified81.1%

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

      \[\leadsto \color{blue}{b \cdot \left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b} - \frac{y}{t + \left(x + y\right)}\right)} \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b} - \frac{y}{t + \left(x + y\right)}\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b}\right), \color{blue}{\left(\frac{y}{t + \left(x + y\right)}\right)}\right)\right) \]
    11. Simplified66.9%

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

      \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\color{blue}{\left(\frac{z}{b}\right)}, \mathsf{/.f64}\left(y, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    13. Step-by-step derivation
      1. /-lowering-/.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, b\right), \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    14. Simplified65.4%

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

    if -3.29999999999999987e-140 < y < 7.79999999999999987e-91

    1. Initial program 82.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 b around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(a \cdot \left(t + y\right) + z \cdot \left(x + y\right)\right)}, \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(t + y\right)\right), \left(z \cdot \left(x + y\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(x, t\right)}, y\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(t + y\right)\right), \left(z \cdot \left(x + y\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{x}, t\right), y\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(t, y\right)\right), \left(z \cdot \left(x + y\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(t, y\right)\right), \mathsf{*.f64}\left(z, \left(x + y\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, \color{blue}{t}\right), y\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(t, y\right)\right), \mathsf{*.f64}\left(z, \left(y + x\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
      6. +-lowering-+.f6468.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(t, y\right)\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(y, x\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
    5. Simplified68.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{-39}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-140}:\\ \;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \left(\frac{a}{z} + \frac{x + y}{\left(x + y\right) + t}\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.65 \cdot 10^{+23}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.30000000000000012e-79 or 1.65000000000000015e23 < z

    1. Initial program 48.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 z around -inf

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

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)\right)\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \color{blue}{\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}}\right)\right)\right) \]
    5. Simplified61.7%

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

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(x\right), y\right), \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(y, x\right)\right)\right), \color{blue}{\left(\frac{a}{z}\right)}\right)\right)\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6475.4%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(x\right), y\right), \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(y, x\right)\right)\right), \mathsf{/.f64}\left(a, \color{blue}{z}\right)\right)\right)\right) \]
    8. Simplified75.4%

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

    if -2.30000000000000012e-79 < z < 1.65000000000000015e23

    1. Initial program 78.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 y around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(a \cdot t + x \cdot z\right)}, \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot t\right), \left(x \cdot z\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{x}, t\right), y\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(x \cdot z\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(z \cdot x\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
      4. *-lowering-*.f6466.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
    5. Simplified66.0%

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

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

Alternative 4: 67.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -8.2 \cdot 10^{-37}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.55 \cdot 10^{-93}:\\ \;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\ \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 -8.2e-37)
     t_1
     (if (<= y 3.55e-93)
       (/ (- (+ (* t a) (* x z)) (* y b)) (+ y (+ x t)))
       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 <= -8.2e-37) {
		tmp = t_1;
	} else if (y <= 3.55e-93) {
		tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + a) - b
    if (y <= (-8.2d-37)) then
        tmp = t_1
    else if (y <= 3.55d-93) then
        tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double tmp;
	if (y <= -8.2e-37) {
		tmp = t_1;
	} else if (y <= 3.55e-93) {
		tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	tmp = 0
	if y <= -8.2e-37:
		tmp = t_1
	elif y <= 3.55e-93:
		tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t))
	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 <= -8.2e-37)
		tmp = t_1;
	elseif (y <= 3.55e-93)
		tmp = Float64(Float64(Float64(Float64(t * a) + Float64(x * z)) - Float64(y * b)) / Float64(y + Float64(x + t)));
	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 <= -8.2e-37)
		tmp = t_1;
	elseif (y <= 3.55e-93)
		tmp = (((t * a) + (x * z)) - (y * b)) / (y + (x + t));
	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, -8.2e-37], t$95$1, If[LessEqual[y, 3.55e-93], N[(N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 3.55 \cdot 10^{-93}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.1999999999999996e-37 or 3.55e-93 < y

    1. Initial program 44.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 y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6468.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified68.9%

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

    if -8.1999999999999996e-37 < y < 3.55e-93

    1. Initial program 80.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 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(a \cdot t + x \cdot z\right)}, \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot t\right), \left(x \cdot z\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{x}, t\right), y\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(x \cdot z\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(z \cdot x\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
      4. *-lowering-*.f6471.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \mathsf{*.f64}\left(y, b\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, t\right), y\right)\right) \]
    5. Simplified71.1%

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

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

Alternative 5: 62.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -2.45 \cdot 10^{-40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-140}:\\ \;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-93}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \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 -2.45e-40)
     t_1
     (if (<= y -2.8e-140)
       (* b (- (/ z b) (/ y (+ (+ x y) t))))
       (if (<= y 4.7e-93) (/ (+ (* t a) (* x z)) (+ x t)) 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 <= -2.45e-40) {
		tmp = t_1;
	} else if (y <= -2.8e-140) {
		tmp = b * ((z / b) - (y / ((x + y) + t)));
	} else if (y <= 4.7e-93) {
		tmp = ((t * a) + (x * z)) / (x + t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + a) - b
    if (y <= (-2.45d-40)) then
        tmp = t_1
    else if (y <= (-2.8d-140)) then
        tmp = b * ((z / b) - (y / ((x + y) + t)))
    else if (y <= 4.7d-93) then
        tmp = ((t * a) + (x * z)) / (x + t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double tmp;
	if (y <= -2.45e-40) {
		tmp = t_1;
	} else if (y <= -2.8e-140) {
		tmp = b * ((z / b) - (y / ((x + y) + t)));
	} else if (y <= 4.7e-93) {
		tmp = ((t * a) + (x * z)) / (x + t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	tmp = 0
	if y <= -2.45e-40:
		tmp = t_1
	elif y <= -2.8e-140:
		tmp = b * ((z / b) - (y / ((x + y) + t)))
	elif y <= 4.7e-93:
		tmp = ((t * a) + (x * z)) / (x + t)
	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 <= -2.45e-40)
		tmp = t_1;
	elseif (y <= -2.8e-140)
		tmp = Float64(b * Float64(Float64(z / b) - Float64(y / Float64(Float64(x + y) + t))));
	elseif (y <= 4.7e-93)
		tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t));
	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 <= -2.45e-40)
		tmp = t_1;
	elseif (y <= -2.8e-140)
		tmp = b * ((z / b) - (y / ((x + y) + t)));
	elseif (y <= 4.7e-93)
		tmp = ((t * a) + (x * z)) / (x + t);
	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, -2.45e-40], t$95$1, If[LessEqual[y, -2.8e-140], N[(b * N[(N[(z / b), $MachinePrecision] - N[(y / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-93], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.8 \cdot 10^{-140}:\\
\;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\

\mathbf{elif}\;y \leq 4.7 \cdot 10^{-93}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.4499999999999999e-40 or 4.6999999999999999e-93 < y

    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 y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6468.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified68.4%

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

    if -2.4499999999999999e-40 < y < -2.8000000000000002e-140

    1. Initial program 75.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 z around -inf

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

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)\right)\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \color{blue}{\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}}\right)\right)\right) \]
    5. Simplified87.1%

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

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(a \cdot \left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(\left(-1 \cdot a\right) \cdot \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(-1 \cdot a\right), \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      5. distribute-lft-out--N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(-1 \cdot \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \mathsf{\_.f64}\left(\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}\right), \color{blue}{\left(\frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right)\right) \]
    8. Simplified81.1%

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

      \[\leadsto \color{blue}{b \cdot \left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b} - \frac{y}{t + \left(x + y\right)}\right)} \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b} - \frac{y}{t + \left(x + y\right)}\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b}\right), \color{blue}{\left(\frac{y}{t + \left(x + y\right)}\right)}\right)\right) \]
    11. Simplified66.9%

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

      \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\color{blue}{\left(\frac{z}{b}\right)}, \mathsf{/.f64}\left(y, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    13. Step-by-step derivation
      1. /-lowering-/.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, b\right), \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    14. Simplified65.4%

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

    if -2.8000000000000002e-140 < y < 4.6999999999999999e-93

    1. Initial program 82.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 0

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(a \cdot t + x \cdot z\right), \color{blue}{\left(t + x\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot t\right), \left(x \cdot z\right)\right), \left(\color{blue}{t} + x\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(x \cdot z\right)\right), \left(t + x\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(z \cdot x\right)\right), \left(t + x\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \left(t + x\right)\right) \]
      6. +-lowering-+.f6462.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \mathsf{+.f64}\left(t, \color{blue}{x}\right)\right) \]
    5. Simplified62.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.45 \cdot 10^{-40}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-140}:\\ \;\;\;\;b \cdot \left(\frac{z}{b} - \frac{y}{\left(x + y\right) + t}\right)\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-93}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := z \cdot \frac{x + y}{t\_1}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+87}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+104}:\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{t\_1}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.19999999999999988e87 or 1.34999999999999992e104 < z

    1. Initial program 41.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 z around -inf

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

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)\right)\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \color{blue}{\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}}\right)\right)\right) \]
    5. Simplified60.9%

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

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(a \cdot \left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(\left(-1 \cdot a\right) \cdot \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(-1 \cdot a\right), \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      5. distribute-lft-out--N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(-1 \cdot \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \mathsf{\_.f64}\left(\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}\right), \color{blue}{\left(\frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right)\right) \]
    8. Simplified70.5%

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

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)}\right)}\right)\right) \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(x + y\right)}{\color{blue}{t + \left(x + y\right)}}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\left(-1 \cdot \left(x + y\right)\right), \color{blue}{\left(t + \left(x + y\right)\right)}\right)\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(x + y\right)\right)\right), \left(\color{blue}{t} + \left(x + y\right)\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(x + y\right)\right), \left(\color{blue}{t} + \left(x + y\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(t + \left(x + y\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(t, \color{blue}{\left(x + y\right)}\right)\right)\right)\right) \]
      7. +-lowering-+.f6475.4%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right)\right)\right)\right) \]
    11. Simplified75.4%

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

    if -7.19999999999999988e87 < z < 1.34999999999999992e104

    1. Initial program 72.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 z around -inf

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

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)\right)\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \color{blue}{\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}}\right)\right)\right) \]
    5. Simplified67.4%

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

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(a \cdot \left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}\right)\right) \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \left(\left(-1 \cdot a\right) \cdot \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(-1 \cdot a\right), \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}} - -1 \cdot \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)\right) \]
      5. distribute-lft-out--N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \left(-1 \cdot \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a} - \frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(\mathsf{neg.f64}\left(a\right), \mathsf{*.f64}\left(-1, \mathsf{\_.f64}\left(\left(\frac{-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}}{a}\right), \color{blue}{\left(\frac{t + y}{z \cdot \left(t + \left(x + y\right)\right)}\right)}\right)\right)\right)\right)\right) \]
    8. Simplified67.7%

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

      \[\leadsto \color{blue}{b \cdot \left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b} - \frac{y}{t + \left(x + y\right)}\right)} \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b} - \frac{y}{t + \left(x + y\right)}\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\left(-1 \cdot \frac{a \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{a \cdot \left(t + \left(x + y\right)\right)} - \left(\frac{t}{z \cdot \left(t + \left(x + y\right)\right)} + \frac{y}{z \cdot \left(t + \left(x + y\right)\right)}\right)\right)\right)}{b}\right), \color{blue}{\left(\frac{y}{t + \left(x + y\right)}\right)}\right)\right) \]
    11. Simplified75.0%

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

      \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\color{blue}{\left(\frac{a}{b}\right)}, \mathsf{/.f64}\left(y, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    13. Step-by-step derivation
      1. /-lowering-/.f6458.0%

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(a, b\right), \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(t, \mathsf{+.f64}\left(x, y\right)\right)\right)\right)\right) \]
    14. Simplified58.0%

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

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

Alternative 7: 63.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -2.45 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{-91}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \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 -2.45e-80)
     t_1
     (if (<= y 1.22e-91) (/ (+ (* t a) (* x z)) (+ x t)) 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 <= -2.45e-80) {
		tmp = t_1;
	} else if (y <= 1.22e-91) {
		tmp = ((t * a) + (x * z)) / (x + t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z + a) - b
    if (y <= (-2.45d-80)) then
        tmp = t_1
    else if (y <= 1.22d-91) then
        tmp = ((t * a) + (x * z)) / (x + t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double tmp;
	if (y <= -2.45e-80) {
		tmp = t_1;
	} else if (y <= 1.22e-91) {
		tmp = ((t * a) + (x * z)) / (x + t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	tmp = 0
	if y <= -2.45e-80:
		tmp = t_1
	elif y <= 1.22e-91:
		tmp = ((t * a) + (x * z)) / (x + t)
	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 <= -2.45e-80)
		tmp = t_1;
	elseif (y <= 1.22e-91)
		tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t));
	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 <= -2.45e-80)
		tmp = t_1;
	elseif (y <= 1.22e-91)
		tmp = ((t * a) + (x * z)) / (x + t);
	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, -2.45e-80], t$95$1, If[LessEqual[y, 1.22e-91], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.22 \cdot 10^{-91}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.44999999999999995e-80 or 1.21999999999999998e-91 < y

    1. Initial program 46.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

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6467.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified67.2%

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

    if -2.44999999999999995e-80 < y < 1.21999999999999998e-91

    1. Initial program 82.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 y around 0

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(a \cdot t + x \cdot z\right), \color{blue}{\left(t + x\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot t\right), \left(x \cdot z\right)\right), \left(\color{blue}{t} + x\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(x \cdot z\right)\right), \left(t + x\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(z \cdot x\right)\right), \left(t + x\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \left(t + x\right)\right) \]
      6. +-lowering-+.f6455.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \mathsf{+.f64}\left(t, \color{blue}{x}\right)\right) \]
    5. Simplified55.9%

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

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

Alternative 8: 59.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.4999999999999997e146 or 1.24999999999999996e78 < x

    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 y around 0

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(a \cdot t + x \cdot z\right), \color{blue}{\left(t + x\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot t\right), \left(x \cdot z\right)\right), \left(\color{blue}{t} + x\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(x \cdot z\right)\right), \left(t + x\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(z \cdot x\right)\right), \left(t + x\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \left(t + x\right)\right) \]
      6. +-lowering-+.f6434.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \mathsf{+.f64}\left(t, \color{blue}{x}\right)\right) \]
    5. Simplified34.6%

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

      \[\leadsto \color{blue}{z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)} \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(z, \color{blue}{\left(t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{*.f64}\left(t, \color{blue}{\left(\frac{a}{x} - \frac{z}{x}\right)}\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{*.f64}\left(t, \mathsf{\_.f64}\left(\left(\frac{a}{x}\right), \color{blue}{\left(\frac{z}{x}\right)}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{*.f64}\left(t, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(a, x\right), \left(\frac{\color{blue}{z}}{x}\right)\right)\right)\right) \]
      5. /-lowering-/.f6464.7%

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{*.f64}\left(t, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(a, x\right), \mathsf{/.f64}\left(z, \color{blue}{x}\right)\right)\right)\right) \]
    8. Simplified64.7%

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

    if -6.4999999999999997e146 < x < 1.24999999999999996e78

    1. Initial program 68.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

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6458.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified58.4%

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

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

Alternative 9: 54.6% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{+78}:\\
\;\;\;\;\left(z + a\right) - b\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.1500000000000001e78

    1. Initial program 63.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

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
      2. +-lowering-+.f6454.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
    5. Simplified54.8%

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

    if 1.1500000000000001e78 < x

    1. Initial program 50.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 0

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(a \cdot t + x \cdot z\right), \color{blue}{\left(t + x\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot t\right), \left(x \cdot z\right)\right), \left(\color{blue}{t} + x\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(x \cdot z\right)\right), \left(t + x\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \left(z \cdot x\right)\right), \left(t + x\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \left(t + x\right)\right) \]
      6. +-lowering-+.f6441.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, t\right), \mathsf{*.f64}\left(z, x\right)\right), \mathsf{+.f64}\left(t, \color{blue}{x}\right)\right) \]
    5. Simplified41.9%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{z}{t + x}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{z}{t + x}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \color{blue}{\left(t + x\right)}\right)\right) \]
      4. +-lowering-+.f6457.7%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(t, \color{blue}{x}\right)\right)\right) \]
    8. Simplified57.7%

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

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

Alternative 10: 43.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+98}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq 6200000000000:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.3999999999999997e98 or 6.2e12 < z

    1. Initial program 44.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 x around inf

      \[\leadsto \color{blue}{z} \]
    4. Step-by-step derivation
      1. Simplified53.8%

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

      if -7.3999999999999997e98 < z < 6.2e12

      1. Initial program 74.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 t around inf

        \[\leadsto \color{blue}{a} \]
      4. Step-by-step derivation
        1. Simplified36.4%

          \[\leadsto \color{blue}{a} \]
      5. Recombined 2 regimes into one program.
      6. Add Preprocessing

      Alternative 11: 55.2% accurate, 2.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.8 \cdot 10^{+78}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
      (FPCore (x y z t a b) :precision binary64 (if (<= x 2.8e+78) (- (+ z a) b) z))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (x <= 2.8e+78) {
      		tmp = (z + a) - b;
      	} else {
      		tmp = z;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a, b)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8) :: tmp
          if (x <= 2.8d+78) then
              tmp = (z + a) - b
          else
              tmp = z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (x <= 2.8e+78) {
      		tmp = (z + a) - b;
      	} else {
      		tmp = z;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	tmp = 0
      	if x <= 2.8e+78:
      		tmp = (z + a) - b
      	else:
      		tmp = z
      	return tmp
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (x <= 2.8e+78)
      		tmp = Float64(Float64(z + a) - b);
      	else
      		tmp = z;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	tmp = 0.0;
      	if (x <= 2.8e+78)
      		tmp = (z + a) - b;
      	else
      		tmp = z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.8e+78], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 2.8 \cdot 10^{+78}:\\
      \;\;\;\;\left(z + a\right) - b\\
      
      \mathbf{else}:\\
      \;\;\;\;z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 2.8000000000000001e78

        1. Initial program 63.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

          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
        4. Step-by-step derivation
          1. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(a + z\right), \color{blue}{b}\right) \]
          2. +-lowering-+.f6454.8%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(a, z\right), b\right) \]
        5. Simplified54.8%

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

        if 2.8000000000000001e78 < x

        1. Initial program 50.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 x around inf

          \[\leadsto \color{blue}{z} \]
        4. Step-by-step derivation
          1. Simplified54.2%

            \[\leadsto \color{blue}{z} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification54.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8 \cdot 10^{+78}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
        7. Add Preprocessing

        Alternative 12: 32.0% 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 61.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

          \[\leadsto \color{blue}{a} \]
        4. Step-by-step derivation
          1. Simplified27.3%

            \[\leadsto \color{blue}{a} \]
          2. Add Preprocessing

          Developer Target 1: 81.5% 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 2024144 
          (FPCore (x y z t a b)
            :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
            :precision binary64
          
            :alt
            (! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))