Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.4% → 88.7%
Time: 15.0s
Alternatives: 13
Speedup: 0.9×

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 13 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.4% 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: 88.7% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+52} \lor \neg \left(z \leq 68000000\right):\\
\;\;\;\;\frac{\frac{y}{\frac{b - y}{x}} + \frac{a - t}{\frac{{\left(b - y\right)}^{2}}{y}}}{z} + \frac{t - a}{b - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.15e52 or 6.8e7 < z

    1. Initial program 43.7%

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

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

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

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

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

    if -2.15e52 < z < 6.8e7

    1. Initial program 90.1%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. sub-neg90.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+52} \lor \neg \left(z \leq 68000000\right):\\ \;\;\;\;\frac{\frac{y}{\frac{b - y}{x}} + \frac{a - t}{\frac{{\left(b - y\right)}^{2}}{y}}}{z} + \frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y + \left(z \cdot b - z \cdot y\right)}\\ \end{array} \]

Alternative 2: 83.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot x - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+89}:\\ \;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (* y x) (* z (- a t))) (+ y (* z (- b y)))))
        (t_2 (/ (- t a) (- b y))))
   (if (<= z -4.2e+34)
     t_2
     (if (<= z 3.6e+50)
       t_1
       (if (<= z 3.2e+89)
         (- (/ (- a t) y) (/ x z))
         (if (<= z 1.3e+136) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)));
	double t_2 = (t - a) / (b - y);
	double tmp;
	if (z <= -4.2e+34) {
		tmp = t_2;
	} else if (z <= 3.6e+50) {
		tmp = t_1;
	} else if (z <= 3.2e+89) {
		tmp = ((a - t) / y) - (x / z);
	} else if (z <= 1.3e+136) {
		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 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)))
    t_2 = (t - a) / (b - y)
    if (z <= (-4.2d+34)) then
        tmp = t_2
    else if (z <= 3.6d+50) then
        tmp = t_1
    else if (z <= 3.2d+89) then
        tmp = ((a - t) / y) - (x / z)
    else if (z <= 1.3d+136) 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 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)));
	double t_2 = (t - a) / (b - y);
	double tmp;
	if (z <= -4.2e+34) {
		tmp = t_2;
	} else if (z <= 3.6e+50) {
		tmp = t_1;
	} else if (z <= 3.2e+89) {
		tmp = ((a - t) / y) - (x / z);
	} else if (z <= 1.3e+136) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)))
	t_2 = (t - a) / (b - y)
	tmp = 0
	if z <= -4.2e+34:
		tmp = t_2
	elif z <= 3.6e+50:
		tmp = t_1
	elif z <= 3.2e+89:
		tmp = ((a - t) / y) - (x / z)
	elif z <= 1.3e+136:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(y * x) - Float64(z * Float64(a - t))) / Float64(y + Float64(z * Float64(b - y))))
	t_2 = Float64(Float64(t - a) / Float64(b - y))
	tmp = 0.0
	if (z <= -4.2e+34)
		tmp = t_2;
	elseif (z <= 3.6e+50)
		tmp = t_1;
	elseif (z <= 3.2e+89)
		tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / z));
	elseif (z <= 1.3e+136)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((y * x) - (z * (a - t))) / (y + (z * (b - y)));
	t_2 = (t - a) / (b - y);
	tmp = 0.0;
	if (z <= -4.2e+34)
		tmp = t_2;
	elseif (z <= 3.6e+50)
		tmp = t_1;
	elseif (z <= 3.2e+89)
		tmp = ((a - t) / y) - (x / z);
	elseif (z <= 1.3e+136)
		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[(y * x), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+34], t$95$2, If[LessEqual[z, 3.6e+50], t$95$1, If[LessEqual[z, 3.2e+89], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+136], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+50}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.20000000000000035e34 or 1.3000000000000001e136 < z

    1. Initial program 37.0%

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

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

    if -4.20000000000000035e34 < z < 3.59999999999999986e50 or 3.19999999999999987e89 < z < 1.3000000000000001e136

    1. Initial program 88.1%

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

    if 3.59999999999999986e50 < z < 3.19999999999999987e89

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-x}{z} - \color{blue}{\frac{t - a}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+34}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+50}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+89}:\\ \;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]

Alternative 3: 83.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+50}:\\
\;\;\;\;\frac{t_1}{y + \left(z \cdot b - z \cdot y\right)}\\

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\
\;\;\;\;\frac{t_1}{y + z \cdot \left(b - y\right)}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.2000000000000002e34 or 1.3000000000000001e136 < z

    1. Initial program 37.0%

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

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

    if -2.2000000000000002e34 < z < 3.89999999999999967e50

    1. Initial program 90.2%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. sub-neg90.2%

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

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

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

    if 3.89999999999999967e50 < z < 4.99999999999999983e89

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999983e89 < z < 1.3000000000000001e136

    1. Initial program 67.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+34}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+50}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y + \left(z \cdot b - z \cdot y\right)}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+89}:\\ \;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+136}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]

Alternative 4: 66.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot x - z \cdot \left(a - t\right)}{y}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -8.2 \cdot 10^{+24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-189}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 0.36:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (* y x) (* z (- a t))) y)) (t_2 (/ (- t a) (- b y))))
   (if (<= z -8.2e+24)
     t_2
     (if (<= z -4.3e-76)
       t_1
       (if (<= z -3.6e-189) x (if (<= z 0.36) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((y * x) - (z * (a - t))) / y;
	double t_2 = (t - a) / (b - y);
	double tmp;
	if (z <= -8.2e+24) {
		tmp = t_2;
	} else if (z <= -4.3e-76) {
		tmp = t_1;
	} else if (z <= -3.6e-189) {
		tmp = x;
	} else if (z <= 0.36) {
		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 = ((y * x) - (z * (a - t))) / y
    t_2 = (t - a) / (b - y)
    if (z <= (-8.2d+24)) then
        tmp = t_2
    else if (z <= (-4.3d-76)) then
        tmp = t_1
    else if (z <= (-3.6d-189)) then
        tmp = x
    else if (z <= 0.36d0) 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 = ((y * x) - (z * (a - t))) / y;
	double t_2 = (t - a) / (b - y);
	double tmp;
	if (z <= -8.2e+24) {
		tmp = t_2;
	} else if (z <= -4.3e-76) {
		tmp = t_1;
	} else if (z <= -3.6e-189) {
		tmp = x;
	} else if (z <= 0.36) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((y * x) - (z * (a - t))) / y
	t_2 = (t - a) / (b - y)
	tmp = 0
	if z <= -8.2e+24:
		tmp = t_2
	elif z <= -4.3e-76:
		tmp = t_1
	elif z <= -3.6e-189:
		tmp = x
	elif z <= 0.36:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(y * x) - Float64(z * Float64(a - t))) / y)
	t_2 = Float64(Float64(t - a) / Float64(b - y))
	tmp = 0.0
	if (z <= -8.2e+24)
		tmp = t_2;
	elseif (z <= -4.3e-76)
		tmp = t_1;
	elseif (z <= -3.6e-189)
		tmp = x;
	elseif (z <= 0.36)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((y * x) - (z * (a - t))) / y;
	t_2 = (t - a) / (b - y);
	tmp = 0.0;
	if (z <= -8.2e+24)
		tmp = t_2;
	elseif (z <= -4.3e-76)
		tmp = t_1;
	elseif (z <= -3.6e-189)
		tmp = x;
	elseif (z <= 0.36)
		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[(y * x), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+24], t$95$2, If[LessEqual[z, -4.3e-76], t$95$1, If[LessEqual[z, -3.6e-189], x, If[LessEqual[z, 0.36], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.3 \cdot 10^{-76}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 0.36:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2000000000000002e24 or 0.35999999999999999 < z

    1. Initial program 47.7%

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

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

    if -8.2000000000000002e24 < z < -4.2999999999999999e-76 or -3.60000000000000017e-189 < z < 0.35999999999999999

    1. Initial program 94.4%

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

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

    if -4.2999999999999999e-76 < z < -3.60000000000000017e-189

    1. Initial program 75.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+24}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-76}:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y}\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-189}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 0.36:\\ \;\;\;\;\frac{y \cdot x - z \cdot \left(a - t\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]

Alternative 5: 42.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t}{b - y}\\ t_2 := \frac{-a}{b}\\ t_3 := \frac{x}{1 - z}\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{-97}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-306}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-217}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+14}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ t (- b y))) (t_2 (/ (- a) b)) (t_3 (/ x (- 1.0 z))))
   (if (<= y -5.2e-97)
     t_3
     (if (<= y -4.2e-248)
       t_1
       (if (<= y 2.5e-306)
         t_2
         (if (<= y 3.4e-217) t_1 (if (<= y 4.7e+14) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t / (b - y);
	double t_2 = -a / b;
	double t_3 = x / (1.0 - z);
	double tmp;
	if (y <= -5.2e-97) {
		tmp = t_3;
	} else if (y <= -4.2e-248) {
		tmp = t_1;
	} else if (y <= 2.5e-306) {
		tmp = t_2;
	} else if (y <= 3.4e-217) {
		tmp = t_1;
	} else if (y <= 4.7e+14) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: tmp
    t_1 = t / (b - y)
    t_2 = -a / b
    t_3 = x / (1.0d0 - z)
    if (y <= (-5.2d-97)) then
        tmp = t_3
    else if (y <= (-4.2d-248)) then
        tmp = t_1
    else if (y <= 2.5d-306) then
        tmp = t_2
    else if (y <= 3.4d-217) then
        tmp = t_1
    else if (y <= 4.7d+14) then
        tmp = t_2
    else
        tmp = t_3
    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 t_2 = -a / b;
	double t_3 = x / (1.0 - z);
	double tmp;
	if (y <= -5.2e-97) {
		tmp = t_3;
	} else if (y <= -4.2e-248) {
		tmp = t_1;
	} else if (y <= 2.5e-306) {
		tmp = t_2;
	} else if (y <= 3.4e-217) {
		tmp = t_1;
	} else if (y <= 4.7e+14) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = t / (b - y)
	t_2 = -a / b
	t_3 = x / (1.0 - z)
	tmp = 0
	if y <= -5.2e-97:
		tmp = t_3
	elif y <= -4.2e-248:
		tmp = t_1
	elif y <= 2.5e-306:
		tmp = t_2
	elif y <= 3.4e-217:
		tmp = t_1
	elif y <= 4.7e+14:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(t / Float64(b - y))
	t_2 = Float64(Float64(-a) / b)
	t_3 = Float64(x / Float64(1.0 - z))
	tmp = 0.0
	if (y <= -5.2e-97)
		tmp = t_3;
	elseif (y <= -4.2e-248)
		tmp = t_1;
	elseif (y <= 2.5e-306)
		tmp = t_2;
	elseif (y <= 3.4e-217)
		tmp = t_1;
	elseif (y <= 4.7e+14)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = t / (b - y);
	t_2 = -a / b;
	t_3 = x / (1.0 - z);
	tmp = 0.0;
	if (y <= -5.2e-97)
		tmp = t_3;
	elseif (y <= -4.2e-248)
		tmp = t_1;
	elseif (y <= 2.5e-306)
		tmp = t_2;
	elseif (y <= 3.4e-217)
		tmp = t_1;
	elseif (y <= 4.7e+14)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-a) / b), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e-97], t$95$3, If[LessEqual[y, -4.2e-248], t$95$1, If[LessEqual[y, 2.5e-306], t$95$2, If[LessEqual[y, 3.4e-217], t$95$1, If[LessEqual[y, 4.7e+14], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
t_2 := \frac{-a}{b}\\
t_3 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{-97}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-306}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-217}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.7 \cdot 10^{+14}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.20000000000000014e-97 or 4.7e14 < y

    1. Initial program 59.8%

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

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

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg48.1%

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

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

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

    if -5.20000000000000014e-97 < y < -4.2e-248 or 2.49999999999999999e-306 < y < 3.40000000000000016e-217

    1. Initial program 90.0%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    3. Taylor expanded in t around inf 49.5%

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

    if -4.2e-248 < y < 2.49999999999999999e-306 or 3.40000000000000016e-217 < y < 4.7e14

    1. Initial program 79.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    7. Simplified47.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{-97}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-306}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-217}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+14}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - z}\\ \end{array} \]

Alternative 6: 60.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+264}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\

\mathbf{elif}\;y \leq -2.9 \cdot 10^{+71} \lor \neg \left(y \leq 6.5 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x}{1 - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.54999999999999991e264

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999991e264 < y < -2.90000000000000007e71 or 6.5000000000000001e90 < y

    1. Initial program 56.0%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative59.7%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg59.7%

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

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

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

    if -2.90000000000000007e71 < y < 6.5000000000000001e90

    1. Initial program 81.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+264}:\\ \;\;\;\;\frac{a - t}{y} - \frac{x}{z}\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+71} \lor \neg \left(y \leq 6.5 \cdot 10^{+90}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]

Alternative 7: 61.0% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.6000000000000005e71 or 1.50000000000000003e91 < y

    1. Initial program 53.0%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative56.7%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg56.7%

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

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

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

    if -4.6000000000000005e71 < y < 1.50000000000000003e91

    1. Initial program 81.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+71} \lor \neg \left(y \leq 1.5 \cdot 10^{+91}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \end{array} \]

Alternative 8: 54.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+71} \lor \neg \left(y \leq 2100\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 -5.5e+71) (not (<= y 2100.0))) (/ 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 <= -5.5e+71) || !(y <= 2100.0)) {
		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 <= (-5.5d+71)) .or. (.not. (y <= 2100.0d0))) 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 <= -5.5e+71) || !(y <= 2100.0)) {
		tmp = x / (1.0 - z);
	} else {
		tmp = (t - a) / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -5.5e+71) or not (y <= 2100.0):
		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 <= -5.5e+71) || !(y <= 2100.0))
		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 <= -5.5e+71) || ~((y <= 2100.0)))
		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, -5.5e+71], N[Not[LessEqual[y, 2100.0]], $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 -5.5 \cdot 10^{+71} \lor \neg \left(y \leq 2100\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 < -5.5e71 or 2100 < y

    1. Initial program 54.6%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative53.5%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg53.5%

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

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

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

    if -5.5e71 < y < 2100

    1. Initial program 82.5%

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

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

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

Alternative 9: 34.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{-a}{b}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{-x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.19999999999999999e-8

    1. Initial program 46.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    7. Simplified41.1%

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

    if -1.19999999999999999e-8 < z < 3.60000000000000009e-5

    1. Initial program 90.4%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative41.7%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg41.7%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
    5. Taylor expanded in z around 0 41.5%

      \[\leadsto \color{blue}{z \cdot x + x} \]

    if 3.60000000000000009e-5 < z

    1. Initial program 51.7%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative24.9%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg24.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
    5. Taylor expanded in z around inf 24.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. associate-*r/24.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z}} \]
      2. mul-1-neg24.2%

        \[\leadsto \frac{\color{blue}{-x}}{z} \]
    7. Simplified24.2%

      \[\leadsto \color{blue}{\frac{-x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-5}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z}\\ \end{array} \]

Alternative 10: 39.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{-a}{b}\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{+14}:\\
\;\;\;\;x + z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.70000000000000004e-7

    1. Initial program 46.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    7. Simplified41.1%

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

    if -3.70000000000000004e-7 < z < 1.32e14

    1. Initial program 90.6%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative41.2%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg41.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
    5. Taylor expanded in z around 0 40.3%

      \[\leadsto \color{blue}{z \cdot x + x} \]

    if 1.32e14 < z

    1. Initial program 48.7%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    3. Taylor expanded in t around inf 44.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+14}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b - y}\\ \end{array} \]

Alternative 11: 36.3% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+20} \lor \neg \left(z \leq 6 \cdot 10^{-74}\right):\\
\;\;\;\;\frac{-a}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8e20 or 6.00000000000000014e-74 < z

    1. Initial program 52.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    7. Simplified30.0%

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

    if -1.8e20 < z < 6.00000000000000014e-74

    1. Initial program 91.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+20} \lor \neg \left(z \leq 6 \cdot 10^{-74}\right):\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 34.4% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{-a}{b}\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-5}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{z}\\


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

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

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

    if -3.8e15 < z < 3.4e-5

    1. Initial program 90.4%

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

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

    if 3.4e-5 < z

    1. Initial program 51.7%

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

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    3. Step-by-step derivation
      1. +-commutative24.9%

        \[\leadsto \frac{x}{\color{blue}{1 + -1 \cdot z}} \]
      2. mul-1-neg24.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
    5. Taylor expanded in z around inf 24.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. associate-*r/24.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z}} \]
      2. mul-1-neg24.2%

        \[\leadsto \frac{\color{blue}{-x}}{z} \]
    7. Simplified24.2%

      \[\leadsto \color{blue}{\frac{-x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+15}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-5}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z}\\ \end{array} \]

Alternative 13: 24.6% 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 70.5%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification22.7%

    \[\leadsto x \]

Developer target: 74.1% 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 2023195 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

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

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