Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.2% → 90.2%
Time: 16.6s
Alternatives: 15
Speedup: 1.0×

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.2% 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: 90.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ \mathbf{if}\;z \leq -3 \cdot 10^{+28} \lor \neg \left(z \leq 11600000000000\right):\\ \;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{a - t}{y - b}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_1}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (* z (- b y)))))
   (if (or (<= z -3e+28) (not (<= z 11600000000000.0)))
     (+
      (+ (* (/ y z) (/ x (- b y))) (/ (- a t) (- y b)))
      (* y (/ (- a t) (* z (pow (- b y) 2.0)))))
     (* x (+ (/ y t_1) (/ (* z (- t a)) (* x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (z * (b - y));
	double tmp;
	if ((z <= -3e+28) || !(z <= 11600000000000.0)) {
		tmp = (((y / z) * (x / (b - y))) + ((a - t) / (y - b))) + (y * ((a - t) / (z * pow((b - y), 2.0))));
	} else {
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 = y + (z * (b - y))
    if ((z <= (-3d+28)) .or. (.not. (z <= 11600000000000.0d0))) then
        tmp = (((y / z) * (x / (b - y))) + ((a - t) / (y - b))) + (y * ((a - t) / (z * ((b - y) ** 2.0d0))))
    else
        tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 = y + (z * (b - y));
	double tmp;
	if ((z <= -3e+28) || !(z <= 11600000000000.0)) {
		tmp = (((y / z) * (x / (b - y))) + ((a - t) / (y - b))) + (y * ((a - t) / (z * Math.pow((b - y), 2.0))));
	} else {
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y + (z * (b - y))
	tmp = 0
	if (z <= -3e+28) or not (z <= 11600000000000.0):
		tmp = (((y / z) * (x / (b - y))) + ((a - t) / (y - b))) + (y * ((a - t) / (z * math.pow((b - y), 2.0))))
	else:
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(z * Float64(b - y)))
	tmp = 0.0
	if ((z <= -3e+28) || !(z <= 11600000000000.0))
		tmp = Float64(Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(a - t) / Float64(y - b))) + Float64(y * Float64(Float64(a - t) / Float64(z * (Float64(b - y) ^ 2.0)))));
	else
		tmp = Float64(x * Float64(Float64(y / t_1) + Float64(Float64(z * Float64(t - a)) / Float64(x * t_1))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y + (z * (b - y));
	tmp = 0.0;
	if ((z <= -3e+28) || ~((z <= 11600000000000.0)))
		tmp = (((y / z) * (x / (b - y))) + ((a - t) / (y - b))) + (y * ((a - t) / (z * ((b - y) ^ 2.0))));
	else
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
	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]}, If[Or[LessEqual[z, -3e+28], N[Not[LessEqual[z, 11600000000000.0]], $MachinePrecision]], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.0000000000000001e28 or 1.16e13 < z

    1. Initial program 42.4%

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate--r+64.5%

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

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

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

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

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

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

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

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

    if -3.0000000000000001e28 < z < 1.16e13

    1. Initial program 86.9%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 91.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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+28} \lor \neg \left(z \leq 11600000000000\right):\\ \;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{a - t}{y - b}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 84.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{+58} \lor \neg \left(z \leq 1.6 \cdot 10^{+94}\right):\\ \;\;\;\;\frac{a - t}{y - b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_1}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (* z (- b y)))))
   (if (or (<= z -5.4e+58) (not (<= z 1.6e+94)))
     (/ (- a t) (- y b))
     (* x (+ (/ y t_1) (/ (* z (- t a)) (* x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (z * (b - y));
	double tmp;
	if ((z <= -5.4e+58) || !(z <= 1.6e+94)) {
		tmp = (a - t) / (y - b);
	} else {
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 = y + (z * (b - y))
    if ((z <= (-5.4d+58)) .or. (.not. (z <= 1.6d+94))) then
        tmp = (a - t) / (y - b)
    else
        tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 = y + (z * (b - y));
	double tmp;
	if ((z <= -5.4e+58) || !(z <= 1.6e+94)) {
		tmp = (a - t) / (y - b);
	} else {
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y + (z * (b - y))
	tmp = 0
	if (z <= -5.4e+58) or not (z <= 1.6e+94):
		tmp = (a - t) / (y - b)
	else:
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(z * Float64(b - y)))
	tmp = 0.0
	if ((z <= -5.4e+58) || !(z <= 1.6e+94))
		tmp = Float64(Float64(a - t) / Float64(y - b));
	else
		tmp = Float64(x * Float64(Float64(y / t_1) + Float64(Float64(z * Float64(t - a)) / Float64(x * t_1))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y + (z * (b - y));
	tmp = 0.0;
	if ((z <= -5.4e+58) || ~((z <= 1.6e+94)))
		tmp = (a - t) / (y - b);
	else
		tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
	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]}, If[Or[LessEqual[z, -5.4e+58], N[Not[LessEqual[z, 1.6e+94]], $MachinePrecision]], N[(N[(a - t), $MachinePrecision] / N[(y - b), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+58} \lor \neg \left(z \leq 1.6 \cdot 10^{+94}\right):\\
\;\;\;\;\frac{a - t}{y - b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4000000000000002e58 or 1.60000000000000007e94 < z

    1. Initial program 38.6%

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

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

    if -5.4000000000000002e58 < z < 1.60000000000000007e94

    1. Initial program 84.6%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 89.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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+58} \lor \neg \left(z \leq 1.6 \cdot 10^{+94}\right):\\ \;\;\;\;\frac{a - t}{y - b}\\ \mathbf{else}:\\ \;\;\;\;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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 81.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -0.025:\\
\;\;\;\;\frac{x}{z \cdot \left(\frac{1}{z} + -1\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8999999999999999e28 or 4.6e11 < z

    1. Initial program 42.1%

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

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

    if -1.8999999999999999e28 < z < -0.025000000000000001

    1. Initial program 89.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 y around inf 79.1%

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

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

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

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

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

    if -0.025000000000000001 < z < 4.6e11

    1. Initial program 87.4%

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

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

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

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

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

Alternative 4: 82.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+130} \lor \neg \left(z \leq 1.8 \cdot 10^{+94}\right):\\
\;\;\;\;\frac{a - t}{y - b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.1e130 or 1.79999999999999996e94 < z

    1. Initial program 29.1%

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

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

    if -3.1e130 < z < 1.79999999999999996e94

    1. Initial program 84.5%

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

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

Alternative 5: 52.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -0.00018:\\
\;\;\;\;\frac{x}{1 - z}\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\

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


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

    1. Initial program 49.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-define49.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b - y} \]
    11. Simplified54.9%

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

    if -1.3e29 < z < -1.80000000000000011e-4

    1. Initial program 89.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 y around inf 79.1%

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

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

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

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

    if -1.80000000000000011e-4 < z < 1.24999999999999997e-13

    1. Initial program 87.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-define87.1%

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

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

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

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

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

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

    if 1.24999999999999997e-13 < z

    1. Initial program 37.0%

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

      \[\leadsto \color{blue}{\frac{t - a}{b}} \]
    4. Step-by-step derivation
      1. div-sub49.8%

        \[\leadsto \color{blue}{\frac{t}{b} - \frac{a}{b}} \]
    5. Applied egg-rr49.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+29}:\\ \;\;\;\;\frac{a}{y - b}\\ \mathbf{elif}\;z \leq -0.00018:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-13}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 52.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -0.00018:\\
\;\;\;\;\frac{x}{1 - z}\\

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

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


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

    1. Initial program 49.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-define49.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b - y} \]
    11. Simplified54.9%

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

    if -2.8999999999999999e29 < z < -1.80000000000000011e-4

    1. Initial program 89.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 y around inf 79.1%

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

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

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

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

    if -1.80000000000000011e-4 < z < 1.99999999999999988e-11

    1. Initial program 87.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-define87.1%

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

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

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

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

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

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

    if 1.99999999999999988e-11 < z

    1. Initial program 37.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+29}:\\ \;\;\;\;\frac{a}{y - b}\\ \mathbf{elif}\;z \leq -0.00018:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-11}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 43.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{1 - z}\\ \mathbf{if}\;y \leq -5 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-134}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-49}:\\ \;\;\;\;\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 -5e+46)
     t_1
     (if (<= y 1.6e-134) (/ t (- b y)) (if (<= y 4.7e-49) (/ 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 <= -5e+46) {
		tmp = t_1;
	} else if (y <= 1.6e-134) {
		tmp = t / (b - y);
	} else if (y <= 4.7e-49) {
		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 <= (-5d+46)) then
        tmp = t_1
    else if (y <= 1.6d-134) then
        tmp = t / (b - y)
    else if (y <= 4.7d-49) 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 <= -5e+46) {
		tmp = t_1;
	} else if (y <= 1.6e-134) {
		tmp = t / (b - y);
	} else if (y <= 4.7e-49) {
		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 <= -5e+46:
		tmp = t_1
	elif y <= 1.6e-134:
		tmp = t / (b - y)
	elif y <= 4.7e-49:
		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 <= -5e+46)
		tmp = t_1;
	elseif (y <= 1.6e-134)
		tmp = Float64(t / Float64(b - y));
	elseif (y <= 4.7e-49)
		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 <= -5e+46)
		tmp = t_1;
	elseif (y <= 1.6e-134)
		tmp = t / (b - y);
	elseif (y <= 4.7e-49)
		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, -5e+46], t$95$1, If[LessEqual[y, 1.6e-134], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-49], N[(a / (-b)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 4.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{a}{-b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.0000000000000002e46 or 4.70000000000000021e-49 < y

    1. Initial program 58.3%

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

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

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

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

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

    if -5.0000000000000002e46 < y < 1.6000000000000001e-134

    1. Initial program 78.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-define78.2%

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

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

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

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

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

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

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

    if 1.6000000000000001e-134 < y < 4.70000000000000021e-49

    1. Initial program 67.5%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 56.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)} \]
    4. Taylor expanded in y around 0 40.4%

      \[\leadsto \color{blue}{x \cdot \left(\frac{t}{b \cdot x} - \frac{a}{b \cdot x}\right)} \]
    5. Step-by-step derivation
      1. div-sub40.4%

        \[\leadsto x \cdot \color{blue}{\frac{t - a}{b \cdot x}} \]
    6. Simplified40.4%

      \[\leadsto \color{blue}{x \cdot \frac{t - a}{b \cdot x}} \]
    7. Taylor expanded in t around 0 51.5%

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    9. Simplified51.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+46}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-134}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-49}:\\ \;\;\;\;\frac{a}{-b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 42.5% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0000000000000001e-100 or 1.80000000000000006e117 < z

    1. Initial program 51.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-define51.5%

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

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

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

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

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

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

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

    if -3.0000000000000001e-100 < z < 4.1e11

    1. Initial program 85.4%

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

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

    if 4.1e11 < z < 1.80000000000000006e117

    1. Initial program 57.8%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z} \]
    8. Simplified44.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-100}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq 410000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+117}:\\ \;\;\;\;\frac{x}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-16} \lor \neg \left(z \leq 1.16 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{a - t}{y - b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.50000000000000017e-16 or 1.16000000000000007e-14 < z

    1. Initial program 47.7%

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

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

    if -3.50000000000000017e-16 < z < 1.16000000000000007e-14

    1. Initial program 86.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-define86.8%

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

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

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

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

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

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

Alternative 10: 36.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{a}{-b}\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+63}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ a (- b))))
   (if (<= z -1.3e+63)
     t_1
     (if (<= z -1.9e-99) (/ t b) (if (<= z 1.15e-10) x 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 <= -1.3e+63) {
		tmp = t_1;
	} else if (z <= -1.9e-99) {
		tmp = t / b;
	} else if (z <= 1.15e-10) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a / -b
    if (z <= (-1.3d+63)) then
        tmp = t_1
    else if (z <= (-1.9d-99)) then
        tmp = t / b
    else if (z <= 1.15d-10) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a / -b;
	double tmp;
	if (z <= -1.3e+63) {
		tmp = t_1;
	} else if (z <= -1.9e-99) {
		tmp = t / b;
	} else if (z <= 1.15e-10) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a / -b
	tmp = 0
	if z <= -1.3e+63:
		tmp = t_1
	elif z <= -1.9e-99:
		tmp = t / b
	elif z <= 1.15e-10:
		tmp = x
	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 <= -1.3e+63)
		tmp = t_1;
	elseif (z <= -1.9e-99)
		tmp = Float64(t / b);
	elseif (z <= 1.15e-10)
		tmp = x;
	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 <= -1.3e+63)
		tmp = t_1;
	elseif (z <= -1.9e-99)
		tmp = t / b;
	elseif (z <= 1.15e-10)
		tmp = x;
	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, -1.3e+63], t$95$1, If[LessEqual[z, -1.9e-99], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.15e-10], x, t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3000000000000001e63 or 1.15000000000000004e-10 < z

    1. Initial program 41.6%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 35.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)} \]
    4. Taylor expanded in y around 0 36.5%

      \[\leadsto \color{blue}{x \cdot \left(\frac{t}{b \cdot x} - \frac{a}{b \cdot x}\right)} \]
    5. Step-by-step derivation
      1. div-sub38.3%

        \[\leadsto x \cdot \color{blue}{\frac{t - a}{b \cdot x}} \]
    6. Simplified38.3%

      \[\leadsto \color{blue}{x \cdot \frac{t - a}{b \cdot x}} \]
    7. Taylor expanded in t around 0 33.0%

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

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

        \[\leadsto \frac{\color{blue}{-a}}{b} \]
    9. Simplified33.0%

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

    if -1.3000000000000001e63 < z < -1.8999999999999998e-99

    1. Initial program 88.8%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 81.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)} \]
    4. Taylor expanded in y around 0 28.7%

      \[\leadsto \color{blue}{x \cdot \left(\frac{t}{b \cdot x} - \frac{a}{b \cdot x}\right)} \]
    5. Step-by-step derivation
      1. div-sub28.9%

        \[\leadsto x \cdot \color{blue}{\frac{t - a}{b \cdot x}} \]
    6. Simplified28.9%

      \[\leadsto \color{blue}{x \cdot \frac{t - a}{b \cdot x}} \]
    7. Taylor expanded in t around inf 29.1%

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

    if -1.8999999999999998e-99 < z < 1.15000000000000004e-10

    1. Initial program 85.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+63}:\\ \;\;\;\;\frac{a}{-b}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 69.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-20} \lor \neg \left(z \leq 1.05 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{a - t}{y - b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.0999999999999999e-20 or 1.0499999999999999e-11 < z

    1. Initial program 48.1%

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

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

    if -2.0999999999999999e-20 < z < 1.0499999999999999e-11

    1. Initial program 86.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-define86.7%

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

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

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-a \cdot z}}{y} \]
      3. distribute-lft-neg-in66.5%

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

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

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

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

Alternative 12: 69.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-59} \lor \neg \left(z \leq 1.7 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{a - t}{y - b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.19999999999999998e-59 or 1.7e-16 < z

    1. Initial program 51.6%

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

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

    if -6.19999999999999998e-59 < z < 1.7e-16

    1. Initial program 85.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-define85.4%

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

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

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

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

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

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

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

Alternative 13: 54.2% accurate, 1.1× speedup?

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

    1. Initial program 58.3%

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

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

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

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

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

    if -6.00000000000000047e46 < y < 3.1999999999999998e-48

    1. Initial program 76.3%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 60.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 -6 \cdot 10^{+46} \lor \neg \left(y \leq 3.2 \cdot 10^{-48}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 35.8% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8999999999999998e-99 or 4.1e11 < z

    1. Initial program 52.1%

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

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

      \[\leadsto \color{blue}{x \cdot \left(\frac{t}{b \cdot x} - \frac{a}{b \cdot x}\right)} \]
    5. Step-by-step derivation
      1. div-sub36.1%

        \[\leadsto x \cdot \color{blue}{\frac{t - a}{b \cdot x}} \]
    6. Simplified36.1%

      \[\leadsto \color{blue}{x \cdot \frac{t - a}{b \cdot x}} \]
    7. Taylor expanded in t around inf 25.2%

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

    if -1.8999999999999998e-99 < z < 4.1e11

    1. Initial program 85.4%

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

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

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

Alternative 15: 25.8% 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.9%

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

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

Developer Target 1: 73.7% 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 2024172 
(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)))))