Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.5% → 92.0%
Time: 14.7s
Alternatives: 14
Speedup: 0.7×

Specification

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

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

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

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

Alternative 1: 92.0% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\

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


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

    1. Initial program 27.9%

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306

    1. Initial program 99.6%

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

    if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 16.9%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.9% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-299} \lor \neg \left(t\_1 \leq 0\right) \land t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\


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

    1. Initial program 27.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306

    1. Initial program 99.6%

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

    if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 19.5%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.4%

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

Alternative 3: 86.3% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-299} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\

\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\


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

    1. Initial program 27.6%

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

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306

    1. Initial program 99.6%

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

    if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 19.5%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.0%

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

Alternative 4: 87.1% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-299} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\

\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\


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

    1. Initial program 27.6%

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999998e-299 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000003e306

    1. Initial program 99.6%

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

    if -1.99999999999999998e-299 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 2.00000000000000003e306 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 19.5%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.3%

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

Alternative 5: 65.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-75}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - \frac{z}{y}\right)\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{-25}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.20000000000000056e-58 or 5.9999999999999995e-25 < z

    1. Initial program 54.6%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]

    if -8.20000000000000056e-58 < z < -6.39999999999999953e-75

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y \cdot x - z \cdot a}{\color{blue}{y}} \]
    7. Taylor expanded in a around inf 86.7%

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

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

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

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

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

    if -6.39999999999999953e-75 < z < -1.2499999999999999e-78

    1. Initial program 100.0%

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

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

        \[\leadsto \frac{\color{blue}{-a \cdot z}}{y + z \cdot \left(b - y\right)} \]
      2. distribute-lft-neg-out100.0%

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

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

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

    if -1.2499999999999999e-78 < z < 5.9999999999999995e-25

    1. Initial program 81.5%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-75}:\\ \;\;\;\;a \cdot \left(\frac{x}{a} - \frac{z}{y}\right)\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-78}:\\ \;\;\;\;\frac{z \cdot a}{z \cdot \left(y - b\right) - y}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-17} \lor \neg \left(z \leq 0.0085\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.45000000000000006e-17 or 0.0085000000000000006 < z

    1. Initial program 51.0%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]

    if -2.45000000000000006e-17 < z < 0.0085000000000000006

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

Alternative 7: 44.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-25}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.9000000000000001e-32 or 3.5999999999999999e-25 < z < 1.5499999999999999e227

    1. Initial program 55.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{b - y}} \]

    if -3.9000000000000001e-32 < z < 3.5999999999999999e-25

    1. Initial program 82.0%

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

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

    if 1.5499999999999999e227 < z

    1. Initial program 43.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/69.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot a}{b}} \]
      2. neg-mul-169.2%

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    8. Simplified69.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{-32}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+227}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 43.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+69}:\\
\;\;\;\;\frac{x}{1 - z}\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+229}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35e-19 or 3.8999999999999999e69 < z < 1.25000000000000012e229

    1. Initial program 48.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{b - y}} \]

    if -1.35e-19 < z < 3.8999999999999999e69

    1. Initial program 81.6%

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

      \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg56.4%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(-z\right)}} \]
      2. unsub-neg56.4%

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
    5. Simplified56.4%

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]

    if 1.25000000000000012e229 < z

    1. Initial program 43.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/69.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot a}{b}} \]
      2. neg-mul-169.2%

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    8. Simplified69.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-19}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+69}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+229}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+196}:\\
\;\;\;\;\frac{a}{y}\\

\mathbf{elif}\;z \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{b}\\

\mathbf{elif}\;z \leq 5.1 \cdot 10^{-21}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.9e196

    1. Initial program 27.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{b - y}} \]
    7. Step-by-step derivation
      1. associate-*r/49.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot a}{b - y}} \]
      2. neg-mul-149.5%

        \[\leadsto \frac{\color{blue}{-a}}{b - y} \]
    8. Simplified49.5%

      \[\leadsto \color{blue}{\frac{-a}{b - y}} \]
    9. Taylor expanded in b around 0 39.5%

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

    if -3.9e196 < z < -2.6499999999999999e-17

    1. Initial program 59.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{b}} \]

    if -2.6499999999999999e-17 < z < 5.10000000000000004e-21

    1. Initial program 82.2%

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

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

    if 5.10000000000000004e-21 < z

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/38.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot a}{b}} \]
      2. neg-mul-138.9%

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    8. Simplified38.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{+196}:\\ \;\;\;\;\frac{a}{y}\\ \mathbf{elif}\;z \leq -2.65 \cdot 10^{-17}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 36.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+197}:\\
\;\;\;\;\frac{a}{y}\\

\mathbf{elif}\;z \leq -2.55 \cdot 10^{-17} \lor \neg \left(z \leq 3.4 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{t}{b}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.79999999999999991e197

    1. Initial program 27.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{b - y}} \]
    7. Step-by-step derivation
      1. associate-*r/49.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot a}{b - y}} \]
      2. neg-mul-149.5%

        \[\leadsto \frac{\color{blue}{-a}}{b - y} \]
    8. Simplified49.5%

      \[\leadsto \color{blue}{\frac{-a}{b - y}} \]
    9. Taylor expanded in b around 0 39.5%

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

    if -1.79999999999999991e197 < z < -2.5500000000000001e-17 or 3.40000000000000002e-25 < z

    1. Initial program 58.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{b}} \]

    if -2.5500000000000001e-17 < z < 3.40000000000000002e-25

    1. Initial program 82.0%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+197}:\\ \;\;\;\;\frac{a}{y}\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{-17} \lor \neg \left(z \leq 3.4 \cdot 10^{-25}\right):\\ \;\;\;\;\frac{t}{b}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 65.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-63} \lor \neg \left(z \leq 5 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.4000000000000001e-63 or 4.9999999999999998e-24 < z

    1. Initial program 54.6%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]

    if -2.4000000000000001e-63 < z < 4.9999999999999998e-24

    1. Initial program 82.1%

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

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

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

Alternative 12: 54.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-71} \lor \neg \left(y \leq 6.5 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{x}{1 - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.89999999999999996e-71 or 6.5e16 < y

    1. Initial program 57.3%

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

      \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg61.1%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(-z\right)}} \]
      2. unsub-neg61.1%

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
    5. Simplified61.1%

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]

    if -1.89999999999999996e-71 < y < 6.5e16

    1. Initial program 81.3%

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

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

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

Alternative 13: 33.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.35 \lor \neg \left(z \leq 118000000000\right):\\
\;\;\;\;\frac{a}{y}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.34999999999999998 or 1.18e11 < z

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{b - y}} \]
    7. Step-by-step derivation
      1. associate-*r/44.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot a}{b - y}} \]
      2. neg-mul-144.7%

        \[\leadsto \frac{\color{blue}{-a}}{b - y} \]
    8. Simplified44.7%

      \[\leadsto \color{blue}{\frac{-a}{b - y}} \]
    9. Taylor expanded in b around 0 19.4%

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

    if -0.34999999999999998 < z < 1.18e11

    1. Initial program 82.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.35 \lor \neg \left(z \leq 118000000000\right):\\ \;\;\;\;\frac{a}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 25.3% accurate, 17.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 67.7%

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

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

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 73.5% accurate, 0.7× speedup?

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

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

Reproduce

?
herbie shell --seed 2024115 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

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

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