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

Percentage Accurate: 59.9% → 87.5%
Time: 15.8s
Alternatives: 16
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 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: 59.9% accurate, 1.0× speedup?

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

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

Alternative 1: 87.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+252}:\\
\;\;\;\;a \cdot \left(\frac{y}{t\_1} + \frac{t}{t\_1}\right) + \frac{z \cdot x + y \cdot \left(z - b\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)) < -inf.0 or 1.0000000000000001e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

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

    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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 87.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+252}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e303 or 1.0000000000000001e252 < (/.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. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

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

    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. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 63.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \left(z - b\right)\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-88}:\\ \;\;\;\;\frac{a \cdot y}{x + y} + z\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-198}:\\ \;\;\;\;\frac{a \cdot t + z \cdot x}{t + x}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-264}:\\ \;\;\;\;a \cdot \frac{t + y}{x} + z\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-72}:\\ \;\;\;\;\frac{a \cdot t}{t + x} + \frac{x \cdot z}{t + x}\\ \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 -1.3e+25)
     t_1
     (if (<= y -4.8e-88)
       (+ (/ (* a y) (+ x y)) z)
       (if (<= y -7.5e-198)
         (/ (+ (* a t) (* z x)) (+ t x))
         (if (<= y -1.95e-264)
           (+ (* a (/ (+ t y) x)) z)
           (if (<= y 2.8e-72)
             (+ (/ (* a t) (+ t x)) (/ (* x z) (+ t 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 <= -1.3e+25) {
		tmp = t_1;
	} else if (y <= -4.8e-88) {
		tmp = ((a * y) / (x + y)) + z;
	} else if (y <= -7.5e-198) {
		tmp = ((a * t) + (z * x)) / (t + x);
	} else if (y <= -1.95e-264) {
		tmp = (a * ((t + y) / x)) + z;
	} else if (y <= 2.8e-72) {
		tmp = ((a * t) / (t + x)) + ((x * z) / (t + 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 <= (-1.3d+25)) then
        tmp = t_1
    else if (y <= (-4.8d-88)) then
        tmp = ((a * y) / (x + y)) + z
    else if (y <= (-7.5d-198)) then
        tmp = ((a * t) + (z * x)) / (t + x)
    else if (y <= (-1.95d-264)) then
        tmp = (a * ((t + y) / x)) + z
    else if (y <= 2.8d-72) then
        tmp = ((a * t) / (t + x)) + ((x * z) / (t + 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 <= -1.3e+25) {
		tmp = t_1;
	} else if (y <= -4.8e-88) {
		tmp = ((a * y) / (x + y)) + z;
	} else if (y <= -7.5e-198) {
		tmp = ((a * t) + (z * x)) / (t + x);
	} else if (y <= -1.95e-264) {
		tmp = (a * ((t + y) / x)) + z;
	} else if (y <= 2.8e-72) {
		tmp = ((a * t) / (t + x)) + ((x * z) / (t + x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a + (z - b)
	tmp = 0
	if y <= -1.3e+25:
		tmp = t_1
	elif y <= -4.8e-88:
		tmp = ((a * y) / (x + y)) + z
	elif y <= -7.5e-198:
		tmp = ((a * t) + (z * x)) / (t + x)
	elif y <= -1.95e-264:
		tmp = (a * ((t + y) / x)) + z
	elif y <= 2.8e-72:
		tmp = ((a * t) / (t + x)) + ((x * z) / (t + x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a + Float64(z - b))
	tmp = 0.0
	if (y <= -1.3e+25)
		tmp = t_1;
	elseif (y <= -4.8e-88)
		tmp = Float64(Float64(Float64(a * y) / Float64(x + y)) + z);
	elseif (y <= -7.5e-198)
		tmp = Float64(Float64(Float64(a * t) + Float64(z * x)) / Float64(t + x));
	elseif (y <= -1.95e-264)
		tmp = Float64(Float64(a * Float64(Float64(t + y) / x)) + z);
	elseif (y <= 2.8e-72)
		tmp = Float64(Float64(Float64(a * t) / Float64(t + x)) + Float64(Float64(x * z) / Float64(t + 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 <= -1.3e+25)
		tmp = t_1;
	elseif (y <= -4.8e-88)
		tmp = ((a * y) / (x + y)) + z;
	elseif (y <= -7.5e-198)
		tmp = ((a * t) + (z * x)) / (t + x);
	elseif (y <= -1.95e-264)
		tmp = (a * ((t + y) / x)) + z;
	elseif (y <= 2.8e-72)
		tmp = ((a * t) / (t + x)) + ((x * z) / (t + x));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+25], t$95$1, If[LessEqual[y, -4.8e-88], N[(N[(N[(a * y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, -7.5e-198], N[(N[(N[(a * t), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.95e-264], N[(N[(a * N[(N[(t + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[y, 2.8e-72], N[(N[(N[(a * t), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.2999999999999999e25 or 2.7999999999999998e-72 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.2999999999999999e25 < y < -4.7999999999999999e-88

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -4.7999999999999999e-88 < y < -7.50000000000000064e-198

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -7.50000000000000064e-198 < y < -1.9499999999999999e-264

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -1.9499999999999999e-264 < y < 2.7999999999999998e-72

    1. Initial program 78.4%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 4: 68.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \left(x + y\right)\\ t_2 := t + \left(y + x\right)\\ t_3 := a \cdot \left(\frac{y}{t\_2} + \frac{t}{t\_2}\right) + z\\ t_4 := a + \left(z - b\right)\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+64}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-291}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-254}:\\ \;\;\;\;\frac{x \cdot z}{t\_1} + \frac{y \cdot \left(z - b\right)}{t\_1}\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-42}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \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 (+ (* a (+ (/ y t_2) (/ t t_2))) z))
        (t_4 (+ a (- z b))))
   (if (<= y -2.4e+64)
     t_4
     (if (<= y 3.3e-291)
       t_3
       (if (<= y 7.8e-254)
         (+ (/ (* x z) t_1) (/ (* y (- z b)) t_1))
         (if (<= y 5.3e-42) t_3 t_4))))))
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 = (a * ((y / t_2) + (t / t_2))) + z;
	double t_4 = a + (z - b);
	double tmp;
	if (y <= -2.4e+64) {
		tmp = t_4;
	} else if (y <= 3.3e-291) {
		tmp = t_3;
	} else if (y <= 7.8e-254) {
		tmp = ((x * z) / t_1) + ((y * (z - b)) / t_1);
	} else if (y <= 5.3e-42) {
		tmp = t_3;
	} 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 = t + (x + y)
    t_2 = t + (y + x)
    t_3 = (a * ((y / t_2) + (t / t_2))) + z
    t_4 = a + (z - b)
    if (y <= (-2.4d+64)) then
        tmp = t_4
    else if (y <= 3.3d-291) then
        tmp = t_3
    else if (y <= 7.8d-254) then
        tmp = ((x * z) / t_1) + ((y * (z - b)) / t_1)
    else if (y <= 5.3d-42) then
        tmp = t_3
    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 = t + (x + y);
	double t_2 = t + (y + x);
	double t_3 = (a * ((y / t_2) + (t / t_2))) + z;
	double t_4 = a + (z - b);
	double tmp;
	if (y <= -2.4e+64) {
		tmp = t_4;
	} else if (y <= 3.3e-291) {
		tmp = t_3;
	} else if (y <= 7.8e-254) {
		tmp = ((x * z) / t_1) + ((y * (z - b)) / t_1);
	} else if (y <= 5.3e-42) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = t + (x + y)
	t_2 = t + (y + x)
	t_3 = (a * ((y / t_2) + (t / t_2))) + z
	t_4 = a + (z - b)
	tmp = 0
	if y <= -2.4e+64:
		tmp = t_4
	elif y <= 3.3e-291:
		tmp = t_3
	elif y <= 7.8e-254:
		tmp = ((x * z) / t_1) + ((y * (z - b)) / t_1)
	elif y <= 5.3e-42:
		tmp = t_3
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(t + Float64(x + y))
	t_2 = Float64(t + Float64(y + x))
	t_3 = Float64(Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2))) + z)
	t_4 = Float64(a + Float64(z - b))
	tmp = 0.0
	if (y <= -2.4e+64)
		tmp = t_4;
	elseif (y <= 3.3e-291)
		tmp = t_3;
	elseif (y <= 7.8e-254)
		tmp = Float64(Float64(Float64(x * z) / t_1) + Float64(Float64(y * Float64(z - b)) / t_1));
	elseif (y <= 5.3e-42)
		tmp = t_3;
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = t + (x + y);
	t_2 = t + (y + x);
	t_3 = (a * ((y / t_2) + (t / t_2))) + z;
	t_4 = a + (z - b);
	tmp = 0.0;
	if (y <= -2.4e+64)
		tmp = t_4;
	elseif (y <= 3.3e-291)
		tmp = t_3;
	elseif (y <= 7.8e-254)
		tmp = ((x * z) / t_1) + ((y * (z - b)) / t_1);
	elseif (y <= 5.3e-42)
		tmp = t_3;
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]}, Block[{t$95$4 = N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+64], t$95$4, If[LessEqual[y, 3.3e-291], t$95$3, If[LessEqual[y, 7.8e-254], N[(N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.3e-42], t$95$3, t$95$4]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-291}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;y \leq 5.3 \cdot 10^{-42}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.39999999999999999e64 or 5.3e-42 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -2.39999999999999999e64 < y < 3.2999999999999999e-291 or 7.8e-254 < y < 5.3e-42

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.2999999999999999e-291 < y < 7.8e-254

    1. Initial program 89.9%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 63.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -2 \cdot 10^{-88}:\\
\;\;\;\;\frac{a \cdot y}{x + y} + z\\

\mathbf{elif}\;y \leq -8.8 \cdot 10^{-198}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 7 \cdot 10^{-72}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35e25 or 7.00000000000000001e-72 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.35e25 < y < -1.99999999999999987e-88

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -1.99999999999999987e-88 < y < -8.8000000000000001e-198 or -1.90000000000000007e-264 < y < 7.00000000000000001e-72

    1. Initial program 79.4%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -8.8000000000000001e-198 < y < -1.90000000000000007e-264

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 6: 63.2% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.69999999999999999e24 or 4.9999999999999996e-78 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -3.69999999999999999e24 < y < -7.20000000000000013e-137

    1. Initial program 82.3%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -7.20000000000000013e-137 < y < -2.7999999999999998e-260

    1. Initial program 61.9%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -2.7999999999999998e-260 < y < 4.9999999999999996e-78

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 7: 57.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \left(z - b\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+32}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.55 \cdot 10^{-177}:\\ \;\;\;\;a + z\\ \mathbf{elif}\;y \leq -5.9 \cdot 10^{-272}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-215}:\\ \;\;\;\;a \cdot \frac{t}{t + x}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-155}:\\ \;\;\;\;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 -1.35e+32)
     t_1
     (if (<= y -3.55e-177)
       (+ a z)
       (if (<= y -5.9e-272)
         z
         (if (<= y 1.7e-215)
           (* a (/ t (+ t x)))
           (if (<= y 2.1e-155) 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 <= -1.35e+32) {
		tmp = t_1;
	} else if (y <= -3.55e-177) {
		tmp = a + z;
	} else if (y <= -5.9e-272) {
		tmp = z;
	} else if (y <= 1.7e-215) {
		tmp = a * (t / (t + x));
	} else if (y <= 2.1e-155) {
		tmp = 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 <= (-1.35d+32)) then
        tmp = t_1
    else if (y <= (-3.55d-177)) then
        tmp = a + z
    else if (y <= (-5.9d-272)) then
        tmp = z
    else if (y <= 1.7d-215) then
        tmp = a * (t / (t + x))
    else if (y <= 2.1d-155) then
        tmp = 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 <= -1.35e+32) {
		tmp = t_1;
	} else if (y <= -3.55e-177) {
		tmp = a + z;
	} else if (y <= -5.9e-272) {
		tmp = z;
	} else if (y <= 1.7e-215) {
		tmp = a * (t / (t + x));
	} else if (y <= 2.1e-155) {
		tmp = z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a + (z - b)
	tmp = 0
	if y <= -1.35e+32:
		tmp = t_1
	elif y <= -3.55e-177:
		tmp = a + z
	elif y <= -5.9e-272:
		tmp = z
	elif y <= 1.7e-215:
		tmp = a * (t / (t + x))
	elif y <= 2.1e-155:
		tmp = z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a + Float64(z - b))
	tmp = 0.0
	if (y <= -1.35e+32)
		tmp = t_1;
	elseif (y <= -3.55e-177)
		tmp = Float64(a + z);
	elseif (y <= -5.9e-272)
		tmp = z;
	elseif (y <= 1.7e-215)
		tmp = Float64(a * Float64(t / Float64(t + x)));
	elseif (y <= 2.1e-155)
		tmp = 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 <= -1.35e+32)
		tmp = t_1;
	elseif (y <= -3.55e-177)
		tmp = a + z;
	elseif (y <= -5.9e-272)
		tmp = z;
	elseif (y <= 1.7e-215)
		tmp = a * (t / (t + x));
	elseif (y <= 2.1e-155)
		tmp = z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+32], t$95$1, If[LessEqual[y, -3.55e-177], N[(a + z), $MachinePrecision], If[LessEqual[y, -5.9e-272], z, If[LessEqual[y, 1.7e-215], N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-155], z, t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -5.9 \cdot 10^{-272}:\\
\;\;\;\;z\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{-215}:\\
\;\;\;\;a \cdot \frac{t}{t + x}\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-155}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000006e32 or 2.1000000000000002e-155 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.35000000000000006e32 < y < -3.55000000000000021e-177

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -3.55000000000000021e-177 < y < -5.8999999999999999e-272 or 1.70000000000000001e-215 < y < 2.1000000000000002e-155

    1. Initial program 69.4%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -5.8999999999999999e-272 < y < 1.70000000000000001e-215

    1. Initial program 80.0%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 8: 58.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -4.5 \cdot 10^{-272}:\\
\;\;\;\;\frac{a \cdot y}{x + y} + z\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.0500000000000001e24 or 2.09999999999999984e-99 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.0500000000000001e24 < y < -4.4999999999999998e-272

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -4.4999999999999998e-272 < y < 1.44999999999999991e-217

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if 1.44999999999999991e-217 < y < 2.09999999999999984e-99

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 9: 58.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -3.4 \cdot 10^{-272}:\\
\;\;\;\;\frac{a \cdot y}{x + y} + z\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-216}:\\
\;\;\;\;a \cdot \frac{t}{t + x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.40000000000000003e24 or 9.4999999999999992e-100 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4.40000000000000003e24 < y < -3.4000000000000003e-272

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -3.4000000000000003e-272 < y < 1.84999999999999998e-216

    1. Initial program 80.0%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
    6. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if 1.84999999999999998e-216 < y < 9.4999999999999992e-100

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 10: 69.3% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.0000000000000006e56 or 5.3e-42 < y

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -9.0000000000000006e56 < y < 5.3e-42

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 62.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot \frac{t + y}{x} + z\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7e167 or 3.6500000000000002e118 < x

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -1.7e167 < x < 3.6500000000000002e118

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 59.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+167}:\\
\;\;\;\;z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.4e167 or 2.29999999999999999e202 < 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 x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -3.4e167 < x < 2.29999999999999999e202

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 52.2% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+92}:\\
\;\;\;\;z - b\\

\mathbf{elif}\;b \leq 1.02 \cdot 10^{+222}:\\
\;\;\;\;a + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.19999999999999992e92 or 1.01999999999999995e222 < b

    1. Initial program 44.6%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -2.19999999999999992e92 < b < 1.01999999999999995e222

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 50.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.8 \cdot 10^{+94}:\\
\;\;\;\;-b\\

\mathbf{elif}\;b \leq 1.7 \cdot 10^{+222}:\\
\;\;\;\;a + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.7999999999999997e94 or 1.70000000000000008e222 < b

    1. Initial program 44.6%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -5.7999999999999997e94 < b < 1.70000000000000008e222

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 44.7% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;t \leq 1.42 \cdot 10^{+48}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.8e14 or 1.42e48 < t

    1. Initial program 47.4%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -3.8e14 < t < 1.42e48

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 32.2% 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 58.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 t around inf 0

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Add Preprocessing

Developer target: 81.5% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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