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

Percentage Accurate: 60.8% → 88.2%
Time: 9.2s
Alternatives: 11
Speedup: 0.4×

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 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 60.8% 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: 88.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + z\right) - b\\ t_2 := \left(t + x\right) + y\\ t_3 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_2}\\ t_4 := t + \left(y + x\right)\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+270}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_1, y, \mathsf{fma}\left(x, z, a \cdot t\right)\right)}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{t}{t\_4} + \mathsf{fma}\left(\frac{z}{t\_4}, \frac{y + x}{a}, \frac{y}{t\_4}\right)\right) - \frac{y}{a} \cdot \frac{b}{t\_4}\right) \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ a z) b))
        (t_2 (+ (+ t x) y))
        (t_3 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_2))
        (t_4 (+ t (+ y x))))
   (if (<= t_3 -5e+270)
     t_1
     (if (<= t_3 4e+303)
       (/ (fma t_1 y (fma x z (* a t))) t_2)
       (*
        (-
         (+ (/ t t_4) (fma (/ z t_4) (/ (+ y x) a) (/ y t_4)))
         (* (/ y a) (/ b t_4)))
        a)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a + z) - b;
	double t_2 = (t + x) + y;
	double t_3 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_2;
	double t_4 = t + (y + x);
	double tmp;
	if (t_3 <= -5e+270) {
		tmp = t_1;
	} else if (t_3 <= 4e+303) {
		tmp = fma(t_1, y, fma(x, z, (a * t))) / t_2;
	} else {
		tmp = (((t / t_4) + fma((z / t_4), ((y + x) / a), (y / t_4))) - ((y / a) * (b / t_4))) * a;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a + z) - b)
	t_2 = Float64(Float64(t + x) + y)
	t_3 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_2)
	t_4 = Float64(t + Float64(y + x))
	tmp = 0.0
	if (t_3 <= -5e+270)
		tmp = t_1;
	elseif (t_3 <= 4e+303)
		tmp = Float64(fma(t_1, y, fma(x, z, Float64(a * t))) / t_2);
	else
		tmp = Float64(Float64(Float64(Float64(t / t_4) + fma(Float64(z / t_4), Float64(Float64(y + x) / a), Float64(y / t_4))) - Float64(Float64(y / a) * Float64(b / t_4))) * a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+270], t$95$1, If[LessEqual[t$95$3, 4e+303], N[(N[(t$95$1 * y + N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[(N[(t / t$95$4), $MachinePrecision] + N[(N[(z / t$95$4), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] / a), $MachinePrecision] + N[(y / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / a), $MachinePrecision] * N[(b / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_1, y, \mathsf{fma}\left(x, z, a \cdot t\right)\right)}{t\_2}\\

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


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

    1. Initial program 8.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. lower--.f64N/A

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6488.7

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites88.7%

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

    if -4.99999999999999976e270 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e303

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(\left(a + z\right) - b\right) \cdot y} + \left(a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      4. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(a + z\right) - b, y, a \cdot t + x \cdot z\right)}}{\left(x + t\right) + y} \]
      5. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(a + z\right) - b}, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(z + a\right)} - b, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      7. lower-+.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(z + a\right)} - b, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      8. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \color{blue}{x \cdot z + a \cdot t}\right)}{\left(x + t\right) + y} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \color{blue}{\mathsf{fma}\left(x, z, a \cdot t\right)}\right)}{\left(x + t\right) + y} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \mathsf{fma}\left(x, z, \color{blue}{t \cdot a}\right)\right)}{\left(x + t\right) + y} \]
      11. lower-*.f6499.7

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

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

    if 4e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 4.2%

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

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

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

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

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(\frac{y}{t + \left(x + y\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}}{b}\right)\right)}\right) \]
      7. unsub-negN/A

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

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

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

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

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

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

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

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

Alternative 2: 68.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t + x\right) + y\\ t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\ t_3 := \left(a + z\right) - b\\ \mathbf{if}\;t\_2 \leq -6 \cdot 10^{+258}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+126}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, a, t\_3 \cdot y\right)}{t + y}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-111}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+159}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ t x) y))
        (t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
        (t_3 (- (+ a z) b)))
   (if (<= t_2 -6e+258)
     t_3
     (if (<= t_2 -1e+126)
       (/ (fma t a (* t_3 y)) (+ t y))
       (if (<= t_2 5e-111)
         (/ (fma x z (* a t)) (+ t x))
         (if (<= t_2 2e+159) (/ (fma x z (* (- z b) y)) t_1) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (t + x) + y;
	double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
	double t_3 = (a + z) - b;
	double tmp;
	if (t_2 <= -6e+258) {
		tmp = t_3;
	} else if (t_2 <= -1e+126) {
		tmp = fma(t, a, (t_3 * y)) / (t + y);
	} else if (t_2 <= 5e-111) {
		tmp = fma(x, z, (a * t)) / (t + x);
	} else if (t_2 <= 2e+159) {
		tmp = fma(x, z, ((z - b) * y)) / t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(t + x) + y)
	t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1)
	t_3 = Float64(Float64(a + z) - b)
	tmp = 0.0
	if (t_2 <= -6e+258)
		tmp = t_3;
	elseif (t_2 <= -1e+126)
		tmp = Float64(fma(t, a, Float64(t_3 * y)) / Float64(t + y));
	elseif (t_2 <= 5e-111)
		tmp = Float64(fma(x, z, Float64(a * t)) / Float64(t + x));
	elseif (t_2 <= 2e+159)
		tmp = Float64(fma(x, z, Float64(Float64(z - b) * y)) / t_1);
	else
		tmp = t_3;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -6e+258], t$95$3, If[LessEqual[t$95$2, -1e+126], N[(N[(t * a + N[(t$95$3 * y), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-111], N[(N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+159], N[(N[(x * z + N[(N[(z - b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+126}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a, t\_3 \cdot y\right)}{t + y}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+159}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, \left(z - b\right) \cdot y\right)}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.9999999999999999e258 or 1.9999999999999999e159 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 16.5%

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

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6476.5

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites76.5%

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

    if -5.9999999999999999e258 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999925e125

    1. Initial program 99.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 x around 0

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

        \[\leadsto \color{blue}{\frac{\left(a \cdot \left(t + y\right) + y \cdot z\right) - b \cdot y}{t + y}} \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{a \cdot \left(t + y\right) + \left(y \cdot z - b \cdot y\right)}}{t + y} \]
      3. distribute-lft-inN/A

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

        \[\leadsto \frac{\color{blue}{a \cdot t + \left(a \cdot y + \left(y \cdot z - b \cdot y\right)\right)}}{t + y} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{t \cdot a} + \left(a \cdot y + \left(y \cdot z - b \cdot y\right)\right)}{t + y} \]
      6. *-commutativeN/A

        \[\leadsto \frac{t \cdot a + \left(\color{blue}{y \cdot a} + \left(y \cdot z - b \cdot y\right)\right)}{t + y} \]
      7. *-commutativeN/A

        \[\leadsto \frac{t \cdot a + \left(y \cdot a + \left(y \cdot z - \color{blue}{y \cdot b}\right)\right)}{t + y} \]
      8. distribute-lft-out--N/A

        \[\leadsto \frac{t \cdot a + \left(y \cdot a + \color{blue}{y \cdot \left(z - b\right)}\right)}{t + y} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{t \cdot a + \color{blue}{y \cdot \left(a + \left(z - b\right)\right)}}{t + y} \]
      10. associate--l+N/A

        \[\leadsto \frac{t \cdot a + y \cdot \color{blue}{\left(\left(a + z\right) - b\right)}}{t + y} \]
      11. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t, a, y \cdot \left(\left(a + z\right) - b\right)\right)}}{t + y} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
      14. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right)} \cdot y\right)}{t + y} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
      16. lower-+.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
      17. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\left(z + a\right) - b\right) \cdot y\right)}{\color{blue}{y + t}} \]
      18. lower-+.f6483.8

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\left(z + a\right) - b\right) \cdot y\right)}{\color{blue}{y + t}} \]
    5. Applied rewrites83.8%

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

    if -9.99999999999999925e125 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e-111

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

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

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot z + a \cdot t}}{t + x} \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, z, \color{blue}{t \cdot a}\right)}{t + x} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{\color{blue}{x + t}} \]
      7. lower-+.f6468.1

        \[\leadsto \frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{\color{blue}{x + t}} \]
    5. Applied rewrites68.1%

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

    if 5.0000000000000003e-111 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.9999999999999999e159

    1. Initial program 99.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 a around 0

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot z + y \cdot z\right)} - b \cdot y}{\left(x + t\right) + y} \]
      2. associate--l+N/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, z, y \cdot z - b \cdot y\right)}}{\left(x + t\right) + y} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, z, y \cdot z - \color{blue}{y \cdot b}\right)}{\left(x + t\right) + y} \]
      5. distribute-lft-out--N/A

        \[\leadsto \frac{\mathsf{fma}\left(x, z, \color{blue}{y \cdot \left(z - b\right)}\right)}{\left(x + t\right) + y} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(x, z, \color{blue}{y \cdot \left(z - b\right)}\right)}{\left(x + t\right) + y} \]
      7. lower--.f6473.9

        \[\leadsto \frac{\mathsf{fma}\left(x, z, y \cdot \color{blue}{\left(z - b\right)}\right)}{\left(x + t\right) + y} \]
    5. Applied rewrites73.9%

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

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

Alternative 3: 88.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t + x\right) + y\\ t_2 := t + \left(y + x\right)\\ t_3 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\ t_4 := \left(a + z\right) - b\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+270}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_4, y, \mathsf{fma}\left(x, z, a \cdot t\right)\right)}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\mathsf{fma}\left(y + x, \frac{z}{t\_2}, \frac{a}{t\_2} \cdot \left(t + y\right)\right)}{b} - \frac{y}{t\_2}\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ t x) y))
        (t_2 (+ t (+ y x)))
        (t_3 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
        (t_4 (- (+ a z) b)))
   (if (<= t_3 -5e+270)
     t_4
     (if (<= t_3 4e+303)
       (/ (fma t_4 y (fma x z (* a t))) t_1)
       (*
        (- (/ (fma (+ y x) (/ z t_2) (* (/ a t_2) (+ t y))) b) (/ y t_2))
        b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (t + x) + y;
	double t_2 = t + (y + x);
	double t_3 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
	double t_4 = (a + z) - b;
	double tmp;
	if (t_3 <= -5e+270) {
		tmp = t_4;
	} else if (t_3 <= 4e+303) {
		tmp = fma(t_4, y, fma(x, z, (a * t))) / t_1;
	} else {
		tmp = ((fma((y + x), (z / t_2), ((a / t_2) * (t + y))) / b) - (y / t_2)) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(t + x) + y)
	t_2 = Float64(t + Float64(y + x))
	t_3 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1)
	t_4 = Float64(Float64(a + z) - b)
	tmp = 0.0
	if (t_3 <= -5e+270)
		tmp = t_4;
	elseif (t_3 <= 4e+303)
		tmp = Float64(fma(t_4, y, fma(x, z, Float64(a * t))) / t_1);
	else
		tmp = Float64(Float64(Float64(fma(Float64(y + x), Float64(z / t_2), Float64(Float64(a / t_2) * Float64(t + y))) / b) - Float64(y / t_2)) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+270], t$95$4, If[LessEqual[t$95$3, 4e+303], N[(N[(t$95$4 * y + N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[(N[(N[(y + x), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision] + N[(N[(a / t$95$2), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_4, y, \mathsf{fma}\left(x, z, a \cdot t\right)\right)}{t\_1}\\

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


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

    1. Initial program 8.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. lower--.f64N/A

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6488.7

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites88.7%

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

    if -4.99999999999999976e270 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4e303

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(\left(a + z\right) - b\right) \cdot y} + \left(a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      4. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(a + z\right) - b, y, a \cdot t + x \cdot z\right)}}{\left(x + t\right) + y} \]
      5. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(a + z\right) - b}, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(z + a\right)} - b, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      7. lower-+.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(z + a\right)} - b, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      8. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \color{blue}{x \cdot z + a \cdot t}\right)}{\left(x + t\right) + y} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \color{blue}{\mathsf{fma}\left(x, z, a \cdot t\right)}\right)}{\left(x + t\right) + y} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \mathsf{fma}\left(x, z, \color{blue}{t \cdot a}\right)\right)}{\left(x + t\right) + y} \]
      11. lower-*.f6499.7

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

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

    if 4e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 4.2%

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

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

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

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

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

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

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

        \[\leadsto \left(-b\right) \cdot \left(\frac{y}{t + \left(x + y\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}}{b}\right)\right)}\right) \]
      7. unsub-negN/A

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

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

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

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

Alternative 4: 67.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\ t_2 := \left(a + z\right) - b\\ \mathbf{if}\;t\_1 \leq -6 \cdot 10^{+258}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+126}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, a, t\_2 \cdot y\right)}{t + y}\\ \mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+214}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
        (t_2 (- (+ a z) b)))
   (if (<= t_1 -6e+258)
     t_2
     (if (<= t_1 -1e+126)
       (/ (fma t a (* t_2 y)) (+ t y))
       (if (<= t_1 1.5e+214) (/ (fma x z (* a t)) (+ t x)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
	double t_2 = (a + z) - b;
	double tmp;
	if (t_1 <= -6e+258) {
		tmp = t_2;
	} else if (t_1 <= -1e+126) {
		tmp = fma(t, a, (t_2 * y)) / (t + y);
	} else if (t_1 <= 1.5e+214) {
		tmp = fma(x, z, (a * t)) / (t + x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y))
	t_2 = Float64(Float64(a + z) - b)
	tmp = 0.0
	if (t_1 <= -6e+258)
		tmp = t_2;
	elseif (t_1 <= -1e+126)
		tmp = Float64(fma(t, a, Float64(t_2 * y)) / Float64(t + y));
	elseif (t_1 <= 1.5e+214)
		tmp = Float64(fma(x, z, Float64(a * t)) / Float64(t + x));
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+258], t$95$2, If[LessEqual[t$95$1, -1e+126], N[(N[(t * a + N[(t$95$2 * y), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+214], N[(N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+126}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a, t\_2 \cdot y\right)}{t + y}\\

\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.9999999999999999e258 or 1.5000000000000001e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

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

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6477.5

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites77.5%

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

    if -5.9999999999999999e258 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999925e125

    1. Initial program 99.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 x around 0

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

        \[\leadsto \color{blue}{\frac{\left(a \cdot \left(t + y\right) + y \cdot z\right) - b \cdot y}{t + y}} \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{a \cdot \left(t + y\right) + \left(y \cdot z - b \cdot y\right)}}{t + y} \]
      3. distribute-lft-inN/A

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

        \[\leadsto \frac{\color{blue}{a \cdot t + \left(a \cdot y + \left(y \cdot z - b \cdot y\right)\right)}}{t + y} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{t \cdot a} + \left(a \cdot y + \left(y \cdot z - b \cdot y\right)\right)}{t + y} \]
      6. *-commutativeN/A

        \[\leadsto \frac{t \cdot a + \left(\color{blue}{y \cdot a} + \left(y \cdot z - b \cdot y\right)\right)}{t + y} \]
      7. *-commutativeN/A

        \[\leadsto \frac{t \cdot a + \left(y \cdot a + \left(y \cdot z - \color{blue}{y \cdot b}\right)\right)}{t + y} \]
      8. distribute-lft-out--N/A

        \[\leadsto \frac{t \cdot a + \left(y \cdot a + \color{blue}{y \cdot \left(z - b\right)}\right)}{t + y} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{t \cdot a + \color{blue}{y \cdot \left(a + \left(z - b\right)\right)}}{t + y} \]
      10. associate--l+N/A

        \[\leadsto \frac{t \cdot a + y \cdot \color{blue}{\left(\left(a + z\right) - b\right)}}{t + y} \]
      11. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t, a, y \cdot \left(\left(a + z\right) - b\right)\right)}}{t + y} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
      14. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right)} \cdot y\right)}{t + y} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
      16. lower-+.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
      17. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\left(z + a\right) - b\right) \cdot y\right)}{\color{blue}{y + t}} \]
      18. lower-+.f6483.8

        \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\left(z + a\right) - b\right) \cdot y\right)}{\color{blue}{y + t}} \]
    5. Applied rewrites83.8%

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

    if -9.99999999999999925e125 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.5000000000000001e214

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

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

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot z + a \cdot t}}{t + x} \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, z, \color{blue}{t \cdot a}\right)}{t + x} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{\color{blue}{x + t}} \]
      7. lower-+.f6465.7

        \[\leadsto \frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{\color{blue}{x + t}} \]
    5. Applied rewrites65.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{x + t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y} \leq -6 \cdot 10^{+258}:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{elif}\;\frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y} \leq -1 \cdot 10^{+126}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, a, \left(\left(a + z\right) - b\right) \cdot y\right)}{t + y}\\ \mathbf{elif}\;\frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y} \leq 1.5 \cdot 10^{+214}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 87.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t + x\right) + y\\ t_2 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{t\_1}\\ t_3 := \left(a + z\right) - b\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+270}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 1.5 \cdot 10^{+214}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_3, y, \mathsf{fma}\left(x, z, a \cdot t\right)\right)}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ t x) y))
        (t_2 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) t_1))
        (t_3 (- (+ a z) b)))
   (if (<= t_2 -5e+270)
     t_3
     (if (<= t_2 1.5e+214) (/ (fma t_3 y (fma x z (* a t))) t_1) t_3))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (t + x) + y;
	double t_2 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / t_1;
	double t_3 = (a + z) - b;
	double tmp;
	if (t_2 <= -5e+270) {
		tmp = t_3;
	} else if (t_2 <= 1.5e+214) {
		tmp = fma(t_3, y, fma(x, z, (a * t))) / t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(t + x) + y)
	t_2 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / t_1)
	t_3 = Float64(Float64(a + z) - b)
	tmp = 0.0
	if (t_2 <= -5e+270)
		tmp = t_3;
	elseif (t_2 <= 1.5e+214)
		tmp = Float64(fma(t_3, y, fma(x, z, Float64(a * t))) / t_1);
	else
		tmp = t_3;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+270], t$95$3, If[LessEqual[t$95$2, 1.5e+214], N[(N[(t$95$3 * y + N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 1.5 \cdot 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_3, y, \mathsf{fma}\left(x, z, a \cdot t\right)\right)}{t\_1}\\

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


\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)) < -4.99999999999999976e270 or 1.5000000000000001e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 12.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. lower--.f64N/A

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

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

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites77.3%

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

    if -4.99999999999999976e270 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.5000000000000001e214

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(\left(a + z\right) - b\right) \cdot y} + \left(a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      4. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(a + z\right) - b, y, a \cdot t + x \cdot z\right)}}{\left(x + t\right) + y} \]
      5. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(a + z\right) - b}, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(z + a\right)} - b, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      7. lower-+.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(z + a\right)} - b, y, a \cdot t + x \cdot z\right)}{\left(x + t\right) + y} \]
      8. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \color{blue}{x \cdot z + a \cdot t}\right)}{\left(x + t\right) + y} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \color{blue}{\mathsf{fma}\left(x, z, a \cdot t\right)}\right)}{\left(x + t\right) + y} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\left(z + a\right) - b, y, \mathsf{fma}\left(x, z, \color{blue}{t \cdot a}\right)\right)}{\left(x + t\right) + y} \]
      11. lower-*.f6499.7

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

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

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

Alternative 6: 67.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(t + y\right) \cdot a + z \cdot \left(y + x\right)\right) - b \cdot y}{\left(t + x\right) + y}\\ t_2 := \left(a + z\right) - b\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+131}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+214}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* (+ t y) a) (* z (+ y x))) (* b y)) (+ (+ t x) y)))
        (t_2 (- (+ a z) b)))
   (if (<= t_1 -1e+131)
     t_2
     (if (<= t_1 1.5e+214) (/ (fma x z (* a t)) (+ t x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((t + y) * a) + (z * (y + x))) - (b * y)) / ((t + x) + y);
	double t_2 = (a + z) - b;
	double tmp;
	if (t_1 <= -1e+131) {
		tmp = t_2;
	} else if (t_1 <= 1.5e+214) {
		tmp = fma(x, z, (a * t)) / (t + x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(z * Float64(y + x))) - Float64(b * y)) / Float64(Float64(t + x) + y))
	t_2 = Float64(Float64(a + z) - b)
	tmp = 0.0
	if (t_1 <= -1e+131)
		tmp = t_2;
	elseif (t_1 <= 1.5e+214)
		tmp = Float64(fma(x, z, Float64(a * t)) / Float64(t + x));
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], t$95$2, If[LessEqual[t$95$1, 1.5e+214], N[(N[(x * z + N[(a * t), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, z, a \cdot t\right)}{t + x}\\

\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)) < -9.9999999999999991e130 or 1.5000000000000001e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 27.5%

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

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6475.5

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites75.5%

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

    if -9.9999999999999991e130 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.5000000000000001e214

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

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

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{x \cdot z + a \cdot t}}{t + x} \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(x, z, \color{blue}{t \cdot a}\right)}{t + x} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{\color{blue}{x + t}} \]
      7. lower-+.f6465.5

        \[\leadsto \frac{\mathsf{fma}\left(x, z, t \cdot a\right)}{\color{blue}{x + t}} \]
    5. Applied rewrites65.5%

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

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

Alternative 7: 57.0% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 49.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. lower--.f64N/A

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6472.6

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites72.6%

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

    if -52000 < y < -2.90000000000000015e-295

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

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      3. lower-+.f6437.1

        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
    5. Applied rewrites37.1%

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

      \[\leadsto a + \color{blue}{z} \]
    7. Step-by-step derivation
      1. Applied rewrites52.0%

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

      if -2.90000000000000015e-295 < y < 4.5000000000000001e-40

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

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

          \[\leadsto \frac{\color{blue}{\left(x + y\right) \cdot z}}{t + \left(x + y\right)} \]
        2. associate-/l*N/A

          \[\leadsto \color{blue}{\left(x + y\right) \cdot \frac{z}{t + \left(x + y\right)}} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(x + y\right) \cdot \frac{z}{t + \left(x + y\right)}} \]
        4. lower-+.f64N/A

          \[\leadsto \color{blue}{\left(x + y\right)} \cdot \frac{z}{t + \left(x + y\right)} \]
        5. lower-/.f64N/A

          \[\leadsto \left(x + y\right) \cdot \color{blue}{\frac{z}{t + \left(x + y\right)}} \]
        6. +-commutativeN/A

          \[\leadsto \left(x + y\right) \cdot \frac{z}{\color{blue}{\left(x + y\right) + t}} \]
        7. lower-+.f64N/A

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

          \[\leadsto \left(x + y\right) \cdot \frac{z}{\color{blue}{\left(x + y\right)} + t} \]
      5. Applied rewrites56.0%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -52000:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-295}:\\ \;\;\;\;a + z\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{z}{t + \left(y + x\right)} \cdot \left(y + x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \]
    10. Add Preprocessing

    Alternative 8: 59.9% accurate, 2.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + z\right) - b\\ \mathbf{if}\;y \leq -52000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-39}:\\ \;\;\;\;a + z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (- (+ a z) b)))
       (if (<= y -52000.0) t_1 (if (<= y 6e-39) (+ a z) t_1))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (a + z) - b;
    	double tmp;
    	if (y <= -52000.0) {
    		tmp = t_1;
    	} else if (y <= 6e-39) {
    		tmp = a + z;
    	} 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 = (a + z) - b
        if (y <= (-52000.0d0)) then
            tmp = t_1
        else if (y <= 6d-39) then
            tmp = a + z
        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 = (a + z) - b;
    	double tmp;
    	if (y <= -52000.0) {
    		tmp = t_1;
    	} else if (y <= 6e-39) {
    		tmp = a + z;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	t_1 = (a + z) - b
    	tmp = 0
    	if y <= -52000.0:
    		tmp = t_1
    	elif y <= 6e-39:
    		tmp = a + z
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(a + z) - b)
    	tmp = 0.0
    	if (y <= -52000.0)
    		tmp = t_1;
    	elseif (y <= 6e-39)
    		tmp = Float64(a + z);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	t_1 = (a + z) - b;
    	tmp = 0.0;
    	if (y <= -52000.0)
    		tmp = t_1;
    	elseif (y <= 6e-39)
    		tmp = a + z;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -52000.0], t$95$1, If[LessEqual[y, 6e-39], N[(a + z), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(a + z\right) - b\\
    \mathbf{if}\;y \leq -52000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq 6 \cdot 10^{-39}:\\
    \;\;\;\;a + z\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -52000 or 6.00000000000000055e-39 < y

      1. Initial program 49.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. lower--.f64N/A

          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
        3. lower-+.f6472.6

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      5. Applied rewrites72.6%

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

      if -52000 < y < 6.00000000000000055e-39

      1. Initial program 76.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. lower--.f64N/A

          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
        3. lower-+.f6435.0

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      5. Applied rewrites35.0%

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

        \[\leadsto a + \color{blue}{z} \]
      7. Step-by-step derivation
        1. Applied rewrites46.6%

          \[\leadsto z + \color{blue}{a} \]
      8. Recombined 2 regimes into one program.
      9. Final simplification61.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -52000:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-39}:\\ \;\;\;\;a + z\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \]
      10. Add Preprocessing

      Alternative 9: 53.1% accurate, 2.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{-44}:\\ \;\;\;\;a + z\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-100}:\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;a + z\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= z -1.2e-44) (+ a z) (if (<= z 7.6e-100) (- a b) (+ a z))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (z <= -1.2e-44) {
      		tmp = a + z;
      	} else if (z <= 7.6e-100) {
      		tmp = a - b;
      	} else {
      		tmp = a + 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 <= (-1.2d-44)) then
              tmp = a + z
          else if (z <= 7.6d-100) then
              tmp = a - b
          else
              tmp = a + 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 <= -1.2e-44) {
      		tmp = a + z;
      	} else if (z <= 7.6e-100) {
      		tmp = a - b;
      	} else {
      		tmp = a + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	tmp = 0
      	if z <= -1.2e-44:
      		tmp = a + z
      	elif z <= 7.6e-100:
      		tmp = a - b
      	else:
      		tmp = a + z
      	return tmp
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (z <= -1.2e-44)
      		tmp = Float64(a + z);
      	elseif (z <= 7.6e-100)
      		tmp = Float64(a - b);
      	else
      		tmp = Float64(a + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	tmp = 0.0;
      	if (z <= -1.2e-44)
      		tmp = a + z;
      	elseif (z <= 7.6e-100)
      		tmp = a - b;
      	else
      		tmp = a + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.2e-44], N[(a + z), $MachinePrecision], If[LessEqual[z, 7.6e-100], N[(a - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1.2 \cdot 10^{-44}:\\
      \;\;\;\;a + z\\
      
      \mathbf{elif}\;z \leq 7.6 \cdot 10^{-100}:\\
      \;\;\;\;a - b\\
      
      \mathbf{else}:\\
      \;\;\;\;a + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.20000000000000004e-44 or 7.59999999999999995e-100 < z

        1. Initial program 57.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. lower--.f64N/A

            \[\leadsto \color{blue}{\left(a + z\right) - b} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\left(z + a\right)} - b \]
          3. lower-+.f6458.8

            \[\leadsto \color{blue}{\left(z + a\right)} - b \]
        5. Applied rewrites58.8%

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

          \[\leadsto a + \color{blue}{z} \]
        7. Step-by-step derivation
          1. Applied rewrites60.1%

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

          if -1.20000000000000004e-44 < z < 7.59999999999999995e-100

          1. Initial program 67.5%

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

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

              \[\leadsto \color{blue}{\left(a + z\right) - b} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
            3. lower-+.f6452.4

              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
          5. Applied rewrites52.4%

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

            \[\leadsto a - \color{blue}{b} \]
          7. Step-by-step derivation
            1. Applied rewrites52.6%

              \[\leadsto a - \color{blue}{b} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification57.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{-44}:\\ \;\;\;\;a + z\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-100}:\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;a + z\\ \end{array} \]
          10. Add Preprocessing

          Alternative 10: 52.1% accurate, 11.3× speedup?

          \[\begin{array}{l} \\ a + z \end{array} \]
          (FPCore (x y z t a b) :precision binary64 (+ a z))
          double code(double x, double y, double z, double t, double a, double b) {
          	return a + z;
          }
          
          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 + z
          end function
          
          public static double code(double x, double y, double z, double t, double a, double b) {
          	return a + z;
          }
          
          def code(x, y, z, t, a, b):
          	return a + z
          
          function code(x, y, z, t, a, b)
          	return Float64(a + z)
          end
          
          function tmp = code(x, y, z, t, a, b)
          	tmp = a + z;
          end
          
          code[x_, y_, z_, t_, a_, b_] := N[(a + z), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          a + z
          \end{array}
          
          Derivation
          1. Initial program 61.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 inf

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

              \[\leadsto \color{blue}{\left(a + z\right) - b} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
            3. lower-+.f6456.4

              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
          5. Applied rewrites56.4%

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

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

              \[\leadsto z + \color{blue}{a} \]
            2. Final simplification52.2%

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

            Alternative 11: 13.4% accurate, 15.0× speedup?

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

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

                \[\leadsto \color{blue}{\left(a + z\right) - b} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{\left(z + a\right)} - b \]
              3. lower-+.f6456.4

                \[\leadsto \color{blue}{\left(z + a\right)} - b \]
            5. Applied rewrites56.4%

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

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

                \[\leadsto -b \]
              2. Add Preprocessing

              Developer Target 1: 82.6% 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 2024257 
              (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)))