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

Percentage Accurate: 60.0% → 92.0%
Time: 15.3s
Alternatives: 11
Speedup: 1.6×

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

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

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

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


\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 2.00000000000000012e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 6.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. Step-by-step derivation
      1. div-sub6.3%

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

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

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

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

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

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

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

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

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

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

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

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

    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. Taylor expanded in y around 0 99.6%

      \[\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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.2%

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

Alternative 2: 73.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-280}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \leq 3.4 \cdot 10^{+139}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.5e106 or 3.4000000000000002e139 < x

    1. Initial program 51.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 z around 0 75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e106 < x < -1.49999999999999994e-280 or 1.5999999999999999e-244 < x < 3.4000000000000002e139

    1. Initial program 60.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. Step-by-step derivation
      1. div-sub60.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999994e-280 < x < 1.5999999999999999e-244

    1. Initial program 81.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 z around 0 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+106}:\\ \;\;\;\;z + \left(\left(a \cdot \frac{y + t}{x} - t \cdot \frac{z}{x}\right) - b \cdot \frac{y}{x}\right)\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-280}:\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-244}:\\ \;\;\;\;\left(a + \frac{y \cdot z}{y + t}\right) - \frac{y \cdot b}{y + t}\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+139}:\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;z + \left(\left(a \cdot \frac{y + t}{x} - t \cdot \frac{z}{x}\right) - b \cdot \frac{y}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 69.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.2 \cdot 10^{+114}:\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x + \left(y + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.2000000000000001e114

    1. Initial program 59.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. Step-by-step derivation
      1. div-sub59.4%

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e114 < t

    1. Initial program 64.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 0 70.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 63.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+118} \lor \neg \left(x \leq 2.1 \cdot 10^{+98}\right):\\
\;\;\;\;z + \frac{y}{x} \cdot \left(a - b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.30000000000000008e118 or 2.10000000000000004e98 < x

    1. Initial program 49.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \left(a \cdot \frac{y}{x} - \color{blue}{b \cdot \frac{y}{x}}\right) \]
      3. distribute-rgt-out--70.9%

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

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

    if -1.30000000000000008e118 < x < 2.10000000000000004e98

    1. Initial program 64.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 62.9%

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

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

Alternative 5: 63.2% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 47.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 0 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e117 < x < 4.99999999999999999e97

    1. Initial program 64.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 62.9%

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

    if 4.99999999999999999e97 < x

    1. Initial program 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \left(a \cdot \frac{y}{x} - \color{blue}{b \cdot \frac{y}{x}}\right) \]
      3. distribute-rgt-out--72.5%

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

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

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

Alternative 6: 61.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+116} \lor \neg \left(x \leq 1.5 \cdot 10^{+196}\right):\\
\;\;\;\;z - b \cdot \frac{y}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.2000000000000002e116 or 1.4999999999999999e196 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z + \color{blue}{-1 \cdot \frac{b \cdot y}{x}} \]
    10. Step-by-step derivation
      1. mul-1-neg59.5%

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

        \[\leadsto z + \color{blue}{\frac{b \cdot y}{-x}} \]
      3. associate-*r/63.0%

        \[\leadsto z + \color{blue}{b \cdot \frac{y}{-x}} \]
    11. Simplified63.0%

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

    if -4.2000000000000002e116 < x < 1.4999999999999999e196

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

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

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

Alternative 7: 69.3% accurate, 1.6× speedup?

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

\\
\left(z + a\right) - y \cdot \frac{b}{x + \left(y + t\right)}
\end{array}
Derivation
  1. Initial program 60.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. Step-by-step derivation
    1. div-sub60.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.4% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 3.2 \cdot 10^{+191}:\\ \;\;\;\;\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 3.2e+191) (- (+ 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 <= 3.2e+191) {
		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 <= 3.2d+191) 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 <= 3.2e+191) {
		tmp = (z + a) - b;
	} else {
		tmp = x * (z / (x + t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= 3.2e+191:
		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 <= 3.2e+191)
		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 <= 3.2e+191)
		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, 3.2e+191], 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 3.2 \cdot 10^{+191}:\\
\;\;\;\;\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 < 3.2000000000000002e191

    1. Initial program 61.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 59.7%

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

    if 3.2000000000000002e191 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y + x\right) \cdot \color{blue}{{\left(\frac{y + \left(t + x\right)}{z}\right)}^{-1}} \]
    7. Applied egg-rr56.6%

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

        \[\leadsto \left(y + x\right) \cdot \color{blue}{\frac{1}{\frac{y + \left(t + x\right)}{z}}} \]
    9. Simplified56.6%

      \[\leadsto \left(y + x\right) \cdot \color{blue}{\frac{1}{\frac{y + \left(t + x\right)}{z}}} \]
    10. Taylor expanded in y around 0 20.1%

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

        \[\leadsto \color{blue}{x \cdot \frac{z}{t + x}} \]
    12. Simplified56.7%

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

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

Alternative 9: 45.6% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6499999999999999e69 or 5.8e11 < z

    1. Initial program 49.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 x around inf 55.1%

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

    if -1.6499999999999999e69 < z < 5.8e11

    1. Initial program 68.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+69}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 580000000000:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.0% accurate, 2.1× speedup?

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

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

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


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

    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 59.4%

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

    if 3.90000000000000013e214 < x

    1. Initial program 43.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 54.3%

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

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

Alternative 11: 32.7% accurate, 21.0× speedup?

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

\\
a
\end{array}
Derivation
  1. Initial program 60.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 t around inf 30.0%

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

    \[\leadsto a \]
  5. Add Preprocessing

Developer target: 82.1% 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 2024044 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

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

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