Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.5% → 95.7%
Time: 18.0s
Alternatives: 15
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 15 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: 95.7% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{x \cdot y}{b - y} - y \cdot t\_4}{z} + \frac{t - a}{b - y}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 69.2%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 69.2%

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999982e-246

    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 -3.99999999999999982e-246 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0

    1. Initial program 23.6%

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

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

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

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

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

      \[\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}} \]
    6. Step-by-step derivation
      1. associate--l+75.1%

        \[\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-neg75.1%

        \[\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--75.1%

        \[\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. *-commutative75.1%

        \[\leadsto \left(-\frac{-1 \cdot \left(\frac{\color{blue}{y \cdot x}}{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*84.2%

        \[\leadsto \left(-\frac{-1 \cdot \left(\frac{y \cdot x}{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-sub84.2%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.8% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{x \cdot y}{b - y} - y \cdot \frac{t - a}{{\left(b - y\right)}^{2}}}{z} + t\_3\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;t\_3 + \frac{x}{1 - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 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 30.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 66.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)} \]
    6. Taylor expanded in x around 0 30.4%

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999982e-246

    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 -3.99999999999999982e-246 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0

    1. Initial program 23.6%

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

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

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

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

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

      \[\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}} \]
    6. Step-by-step derivation
      1. associate--l+75.1%

        \[\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-neg75.1%

        \[\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--75.1%

        \[\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. *-commutative75.1%

        \[\leadsto \left(-\frac{-1 \cdot \left(\frac{\color{blue}{y \cdot x}}{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*84.2%

        \[\leadsto \left(-\frac{-1 \cdot \left(\frac{y \cdot x}{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-sub84.2%

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

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

    if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e288

    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
    3. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

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

    1. Initial program 10.3%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 10.3%

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

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

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

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

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

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

      \[\leadsto \frac{t - a}{b - y} + \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    11. Step-by-step derivation
      1. neg-mul-186.9%

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

        \[\leadsto \frac{t - a}{b - y} + \frac{x}{\color{blue}{1 - z}} \]
    12. Simplified86.9%

      \[\leadsto \frac{t - a}{b - y} + \color{blue}{\frac{x}{1 - z}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification95.3%

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

Alternative 3: 94.8% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-247}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t\_1}\\

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


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

    1. Initial program 15.7%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 15.7%

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

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

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

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

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

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

      \[\leadsto \frac{t - a}{b - y} + \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    11. Step-by-step derivation
      1. neg-mul-188.1%

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

        \[\leadsto \frac{t - a}{b - y} + \frac{x}{\color{blue}{1 - z}} \]
    12. Simplified88.1%

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-247

    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 -2e-247 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0

    1. Initial program 19.6%

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

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

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

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

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

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

    if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e288

    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
    3. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

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

Alternative 4: 94.8% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-247}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 15.7%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 15.7%

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

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

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

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

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

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

      \[\leadsto \frac{t - a}{b - y} + \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    11. Step-by-step derivation
      1. neg-mul-188.1%

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

        \[\leadsto \frac{t - a}{b - y} + \frac{x}{\color{blue}{1 - z}} \]
    12. Simplified88.1%

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-247 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e288

    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 -2e-247 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0

    1. Initial program 19.6%

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

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

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

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

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

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

Alternative 5: 89.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ t_2 := y + z \cdot \left(b - y\right)\\ t_3 := x \cdot \frac{y}{t\_2}\\ \mathbf{if}\;z \leq -1220000000000:\\ \;\;\;\;t\_3 + t\_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+58}:\\ \;\;\;\;z \cdot \frac{t - a}{t\_2} + t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \frac{x}{1 - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- t a) (- b y)))
        (t_2 (+ y (* z (- b y))))
        (t_3 (* x (/ y t_2))))
   (if (<= z -1220000000000.0)
     (+ t_3 t_1)
     (if (<= z 1.45e+58)
       (+ (* z (/ (- t a) t_2)) t_3)
       (+ t_1 (/ x (- 1.0 z)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (t - a) / (b - y);
	double t_2 = y + (z * (b - y));
	double t_3 = x * (y / t_2);
	double tmp;
	if (z <= -1220000000000.0) {
		tmp = t_3 + t_1;
	} else if (z <= 1.45e+58) {
		tmp = (z * ((t - a) / t_2)) + t_3;
	} else {
		tmp = t_1 + (x / (1.0 - 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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (t - a) / (b - y)
    t_2 = y + (z * (b - y))
    t_3 = x * (y / t_2)
    if (z <= (-1220000000000.0d0)) then
        tmp = t_3 + t_1
    else if (z <= 1.45d+58) then
        tmp = (z * ((t - a) / t_2)) + t_3
    else
        tmp = t_1 + (x / (1.0d0 - z))
    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 t_2 = y + (z * (b - y));
	double t_3 = x * (y / t_2);
	double tmp;
	if (z <= -1220000000000.0) {
		tmp = t_3 + t_1;
	} else if (z <= 1.45e+58) {
		tmp = (z * ((t - a) / t_2)) + t_3;
	} else {
		tmp = t_1 + (x / (1.0 - z));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (t - a) / (b - y)
	t_2 = y + (z * (b - y))
	t_3 = x * (y / t_2)
	tmp = 0
	if z <= -1220000000000.0:
		tmp = t_3 + t_1
	elif z <= 1.45e+58:
		tmp = (z * ((t - a) / t_2)) + t_3
	else:
		tmp = t_1 + (x / (1.0 - z))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(t - a) / Float64(b - y))
	t_2 = Float64(y + Float64(z * Float64(b - y)))
	t_3 = Float64(x * Float64(y / t_2))
	tmp = 0.0
	if (z <= -1220000000000.0)
		tmp = Float64(t_3 + t_1);
	elseif (z <= 1.45e+58)
		tmp = Float64(Float64(z * Float64(Float64(t - a) / t_2)) + t_3);
	else
		tmp = Float64(t_1 + Float64(x / Float64(1.0 - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (t - a) / (b - y);
	t_2 = y + (z * (b - y));
	t_3 = x * (y / t_2);
	tmp = 0.0;
	if (z <= -1220000000000.0)
		tmp = t_3 + t_1;
	elseif (z <= 1.45e+58)
		tmp = (z * ((t - a) / t_2)) + t_3;
	else
		tmp = t_1 + (x / (1.0 - z));
	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]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1220000000000.0], N[(t$95$3 + t$95$1), $MachinePrecision], If[LessEqual[z, 1.45e+58], N[(N[(z * N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(t$95$1 + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+58}:\\
\;\;\;\;z \cdot \frac{t - a}{t\_2} + t\_3\\

\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{x}{1 - z}\\


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

    1. Initial program 43.8%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 43.8%

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

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

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

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

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

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

    if -1.22e12 < z < 1.45000000000000001e58

    1. Initial program 82.3%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 82.3%

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

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

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

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

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

    if 1.45000000000000001e58 < z

    1. Initial program 42.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 37.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)} \]
    6. Taylor expanded in x around 0 42.0%

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

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

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

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

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

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

      \[\leadsto \frac{t - a}{b - y} + \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    11. Step-by-step derivation
      1. neg-mul-190.4%

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

        \[\leadsto \frac{t - a}{b - y} + \frac{x}{\color{blue}{1 - z}} \]
    12. Simplified90.4%

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

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

Alternative 6: 69.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-8}:\\ \;\;\;\;x + z \cdot \frac{t - a}{y}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y}\\ \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 -1.05e-19)
     t_1
     (if (<= z 5.5e-8)
       (+ x (* z (/ (- t a) y)))
       (if (<= z 1.02e+85) (* (/ x z) (/ y (- b y))) 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 <= -1.05e-19) {
		tmp = t_1;
	} else if (z <= 5.5e-8) {
		tmp = x + (z * ((t - a) / y));
	} else if (z <= 1.02e+85) {
		tmp = (x / z) * (y / (b - y));
	} 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 <= (-1.05d-19)) then
        tmp = t_1
    else if (z <= 5.5d-8) then
        tmp = x + (z * ((t - a) / y))
    else if (z <= 1.02d+85) then
        tmp = (x / z) * (y / (b - y))
    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 <= -1.05e-19) {
		tmp = t_1;
	} else if (z <= 5.5e-8) {
		tmp = x + (z * ((t - a) / y));
	} else if (z <= 1.02e+85) {
		tmp = (x / z) * (y / (b - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (t - a) / (b - y)
	tmp = 0
	if z <= -1.05e-19:
		tmp = t_1
	elif z <= 5.5e-8:
		tmp = x + (z * ((t - a) / y))
	elif z <= 1.02e+85:
		tmp = (x / z) * (y / (b - y))
	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 <= -1.05e-19)
		tmp = t_1;
	elseif (z <= 5.5e-8)
		tmp = Float64(x + Float64(z * Float64(Float64(t - a) / y)));
	elseif (z <= 1.02e+85)
		tmp = Float64(Float64(x / z) * Float64(y / Float64(b - y)));
	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 <= -1.05e-19)
		tmp = t_1;
	elseif (z <= 5.5e-8)
		tmp = x + (z * ((t - a) / y));
	elseif (z <= 1.02e+85)
		tmp = (x / z) * (y / (b - y));
	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, -1.05e-19], t$95$1, If[LessEqual[z, 5.5e-8], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+85], N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.0499999999999999e-19 or 1.02e85 < z

    1. Initial program 48.3%

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

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

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

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

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

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

    if -1.0499999999999999e-19 < z < 5.5000000000000003e-8

    1. Initial program 83.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 0 63.1%

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{t - a}{y}} \]
    6. Simplified74.6%

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

    if 5.5000000000000003e-8 < z < 1.02e85

    1. Initial program 54.2%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around inf 41.3%

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z \cdot \left(b - y\right)}} \]
    10. Step-by-step derivation
      1. times-frac67.8%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{b - y}} \]
    11. Simplified67.8%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{y}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 75.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-24} \lor \neg \left(z \leq 2.55 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{t - a}{b - y} + \frac{x}{1 - z}\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4999999999999999e-24 or 2.5499999999999999e-45 < z

    1. Initial program 52.5%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around 0 52.5%

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

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

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

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

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

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

      \[\leadsto \frac{t - a}{b - y} + \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    11. Step-by-step derivation
      1. neg-mul-177.6%

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

        \[\leadsto \frac{t - a}{b - y} + \frac{x}{\color{blue}{1 - z}} \]
    12. Simplified77.6%

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

    if -5.4999999999999999e-24 < z < 2.5499999999999999e-45

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{t - a}{y}} \]
    6. Simplified77.6%

      \[\leadsto \color{blue}{x + z \cdot \frac{t - a}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.6%

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

Alternative 8: 41.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -8 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.3 \cdot 10^{-251}:\\
\;\;\;\;\frac{t}{b}\\

\mathbf{elif}\;y \leq 8200:\\
\;\;\;\;\frac{a}{-b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.0000000000000003e-26 or 8200 < y

    1. Initial program 58.6%

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

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

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

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

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

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

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

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

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

    if -8.0000000000000003e-26 < y < -3.3e-251

    1. Initial program 80.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 67.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)} \]
    6. Taylor expanded in b around inf 67.5%

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

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

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

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

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

    if -3.3e-251 < y < 8200

    1. Initial program 74.1%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in b around inf 47.0%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    11. Simplified38.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-251}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;y \leq 8200:\\ \;\;\;\;\frac{a}{-b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 68.7% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25999999999999992e-24 or 8.5000000000000007e-36 < z

    1. Initial program 51.5%

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

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

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

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

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

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

    if -1.25999999999999992e-24 < z < 8.5000000000000007e-36

    1. Initial program 82.7%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in x around inf 48.2%

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

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

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

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

        \[\leadsto x \cdot \frac{y}{y + \color{blue}{z \cdot b}} \]
    11. Simplified62.8%

      \[\leadsto x \cdot \frac{y}{y + \color{blue}{z \cdot b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.6%

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

Alternative 10: 36.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq 4050:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.26 \cdot 10^{+132}:\\
\;\;\;\;\frac{x}{-z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.8e19 or 1.25999999999999999e132 < z

    1. Initial program 41.3%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in b around inf 44.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    11. Simplified32.8%

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

    if -6.8e19 < z < 4050

    1. Initial program 83.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 47.5%

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

    if 4050 < z < 1.25999999999999999e132

    1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z} \]
    10. Simplified37.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+19}:\\ \;\;\;\;\frac{a}{-b}\\ \mathbf{elif}\;z \leq 4050:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{+132}:\\ \;\;\;\;\frac{x}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 64.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-23} \lor \neg \left(z \leq 7.4 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3e-23 or 7.4000000000000005e-60 < z

    1. Initial program 53.7%

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

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

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

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

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

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

    if -1.3e-23 < z < 7.4000000000000005e-60

    1. Initial program 81.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 57.0%

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

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

Alternative 12: 54.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{-25} \lor \neg \left(y \leq 12000\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.95e-25) (not (<= y 12000.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 <= -1.95e-25) || !(y <= 12000.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 <= (-1.95d-25)) .or. (.not. (y <= 12000.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 <= -1.95e-25) || !(y <= 12000.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 <= -1.95e-25) or not (y <= 12000.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 <= -1.95e-25) || !(y <= 12000.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 <= -1.95e-25) || ~((y <= 12000.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, -1.95e-25], N[Not[LessEqual[y, 12000.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 -1.95 \cdot 10^{-25} \lor \neg \left(y \leq 12000\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.95e-25 or 12000 < y

    1. Initial program 58.6%

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

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

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

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

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

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

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

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

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

    if -1.95e-25 < y < 12000

    1. Initial program 76.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 56.3%

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

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

Alternative 13: 36.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+18} \lor \neg \left(z \leq 3.05 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{a}{-b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.2e18 or 3.0499999999999999e-56 < z

    1. Initial program 49.6%

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

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

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

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

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

      \[\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)} \]
    6. Taylor expanded in b around inf 44.4%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    11. Simplified28.2%

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

    if -7.2e18 < z < 3.0499999999999999e-56

    1. Initial program 81.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 51.0%

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

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

Alternative 14: 37.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-19} \lor \neg \left(z \leq 1.05 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{t}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.0499999999999999e-19 or 1.05e-35 < z

    1. Initial program 50.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. 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)} \]
    6. Taylor expanded in b around inf 40.9%

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

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

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

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

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

    if -1.0499999999999999e-19 < z < 1.05e-35

    1. Initial program 83.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 55.3%

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

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

Alternative 15: 26.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 65.5%

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

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

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

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in z around 0 27.4%

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

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

  :alt
  (! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))

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