Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.9% → 89.1%
Time: 16.2s
Alternatives: 15
Speedup: 0.8×

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.5e76 or 1.7000000000000001e26 < z

    1. Initial program 38.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-define38.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. +-commutative38.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-define38.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. Simplified38.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 z around inf 75.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. associate--r+75.2%

        \[\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. +-commutative75.2%

        \[\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+75.2%

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

        \[\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-frac78.4%

        \[\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-sub78.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*94.4%

        \[\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}}} \]
    7. Simplified94.4%

      \[\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.5e76 < z < 1.7000000000000001e26

    1. Initial program 91.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-define91.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. +-commutative91.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-define91.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. Simplified91.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
  3. Recombined 2 regimes into one program.
  4. Final simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+76} \lor \neg \left(z \leq 1.7 \cdot 10^{+26}\right):\\ \;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 89.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+76} \lor \neg \left(z \leq 4.3 \cdot 10^{+21}\right):\\ \;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\ \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.5e+76) (not (<= z 4.3e+21)))
   (+
    (+ (* (/ y z) (/ x (- b y))) (/ (- t a) (- b y)))
    (* y (/ (- a t) (* z (pow (- b y) 2.0)))))
   (/ (+ (* 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.5e+76) || !(z <= 4.3e+21)) {
		tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * pow((b - y), 2.0))));
	} 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.5d+76)) .or. (.not. (z <= 4.3d+21))) then
        tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * ((b - y) ** 2.0d0))))
    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.5e+76) || !(z <= 4.3e+21)) {
		tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * Math.pow((b - y), 2.0))));
	} 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.5e+76) or not (z <= 4.3e+21):
		tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * math.pow((b - y), 2.0))))
	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.5e+76) || !(z <= 4.3e+21))
		tmp = Float64(Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / Float64(z * (Float64(b - y) ^ 2.0)))));
	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.5e+76) || ~((z <= 4.3e+21)))
		tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * ((b - y) ^ 2.0))));
	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.5e+76], N[Not[LessEqual[z, 4.3e+21]], $MachinePrecision]], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $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[(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.5 \cdot 10^{+76} \lor \neg \left(z \leq 4.3 \cdot 10^{+21}\right):\\
\;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\

\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.5e76 or 4.3e21 < z

    1. Initial program 38.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-define38.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. +-commutative38.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-define38.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. Simplified38.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 z around inf 75.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. associate--r+75.2%

        \[\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. +-commutative75.2%

        \[\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+75.2%

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

        \[\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-frac78.4%

        \[\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-sub78.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*94.4%

        \[\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}}} \]
    7. Simplified94.4%

      \[\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.5e76 < z < 4.3e21

    1. Initial program 91.2%

      \[\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 simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+76} \lor \neg \left(z \leq 4.3 \cdot 10^{+21}\right):\\ \;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\ \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 3: 69.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -1.45 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{-90}:\\
\;\;\;\;\frac{x + t \cdot \frac{z}{y}}{\left(-z\right) - -1}\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0000000000000001e30 or 1.15e-5 < z

    1. Initial program 44.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-define44.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. +-commutative44.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-define44.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. Simplified44.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 85.3%

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

    if -4.0000000000000001e30 < z < -1.45e-149 or 1.85000000000000009e-90 < z < 1.15e-5

    1. Initial program 93.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-define93.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. +-commutative93.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-define93.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. Simplified93.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 0 71.9%

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

    if -1.45e-149 < z < 1.85000000000000009e-90

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x + \frac{t \cdot z}{y}}{z - 1}} \]
    12. Step-by-step derivation
      1. mul-1-neg69.7%

        \[\leadsto \color{blue}{-\frac{x + \frac{t \cdot z}{y}}{z - 1}} \]
      2. associate-/l*69.9%

        \[\leadsto -\frac{x + \color{blue}{t \cdot \frac{z}{y}}}{z - 1} \]
      3. sub-neg69.9%

        \[\leadsto -\frac{x + t \cdot \frac{z}{y}}{\color{blue}{z + \left(-1\right)}} \]
      4. metadata-eval69.9%

        \[\leadsto -\frac{x + t \cdot \frac{z}{y}}{z + \color{blue}{-1}} \]
      5. +-commutative69.9%

        \[\leadsto -\frac{x + t \cdot \frac{z}{y}}{\color{blue}{-1 + z}} \]
    13. Simplified69.9%

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

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

Alternative 4: 73.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -4 \cdot 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-149}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 9000:\\ \;\;\;\;\frac{y \cdot \left(x + z \cdot \frac{t - a}{y}\right)}{y + z \cdot b}\\ \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 -4e+30)
     t_1
     (if (<= z -1.5e-149)
       (/ (* z (- t a)) (+ y (* z (- b y))))
       (if (<= z 9000.0)
         (/ (* y (+ x (* z (/ (- t a) y)))) (+ y (* z b)))
         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 <= -4e+30) {
		tmp = t_1;
	} else if (z <= -1.5e-149) {
		tmp = (z * (t - a)) / (y + (z * (b - y)));
	} else if (z <= 9000.0) {
		tmp = (y * (x + (z * ((t - a) / y)))) / (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 = (t - a) / (b - y)
    if (z <= (-4d+30)) then
        tmp = t_1
    else if (z <= (-1.5d-149)) then
        tmp = (z * (t - a)) / (y + (z * (b - y)))
    else if (z <= 9000.0d0) then
        tmp = (y * (x + (z * ((t - a) / y)))) / (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 = (t - a) / (b - y);
	double tmp;
	if (z <= -4e+30) {
		tmp = t_1;
	} else if (z <= -1.5e-149) {
		tmp = (z * (t - a)) / (y + (z * (b - y)));
	} else if (z <= 9000.0) {
		tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * b));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (t - a) / (b - y)
	tmp = 0
	if z <= -4e+30:
		tmp = t_1
	elif z <= -1.5e-149:
		tmp = (z * (t - a)) / (y + (z * (b - y)))
	elif z <= 9000.0:
		tmp = (y * (x + (z * ((t - a) / y)))) / (y + (z * b))
	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 <= -4e+30)
		tmp = t_1;
	elseif (z <= -1.5e-149)
		tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y))));
	elseif (z <= 9000.0)
		tmp = Float64(Float64(y * Float64(x + Float64(z * Float64(Float64(t - a) / y)))) / 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 = (t - a) / (b - y);
	tmp = 0.0;
	if (z <= -4e+30)
		tmp = t_1;
	elseif (z <= -1.5e-149)
		tmp = (z * (t - a)) / (y + (z * (b - y)));
	elseif (z <= 9000.0)
		tmp = (y * (x + (z * ((t - a) / y)))) / (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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+30], t$95$1, If[LessEqual[z, -1.5e-149], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9000.0], N[(N[(y * N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-149}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0000000000000001e30 or 9e3 < z

    1. Initial program 44.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-define44.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. +-commutative44.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-define44.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. Simplified44.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 86.6%

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

    if -4.0000000000000001e30 < z < -1.5000000000000001e-149

    1. Initial program 91.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-define91.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. +-commutative91.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-define91.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. Simplified91.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 0 74.8%

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

    if -1.5000000000000001e-149 < z < 9e3

    1. Initial program 90.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-define90.0%

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

      \[\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 y around inf 89.0%

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

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

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

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

Alternative 5: 72.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t\_1}\\

\mathbf{elif}\;z \leq 126000000:\\
\;\;\;\;\frac{y \cdot x + z \cdot t}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.9999999999999996e30 or 1.26e8 < z

    1. Initial program 44.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-define44.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. +-commutative44.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-define44.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. Simplified44.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 86.6%

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

    if -9.9999999999999996e30 < z < -3.79999999999999994e-146

    1. Initial program 91.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-define91.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. +-commutative91.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-define91.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. Simplified91.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 0 74.2%

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

    if -3.79999999999999994e-146 < z < 1.26e8

    1. Initial program 90.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 t around inf 73.5%

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

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

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

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

Alternative 6: 85.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+77} \lor \neg \left(z \leq 1.45 \cdot 10^{+64}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \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.2e+77) (not (<= z 1.45e+64)))
   (/ (- t a) (- b y))
   (/ (+ (* 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.2e+77) || !(z <= 1.45e+64)) {
		tmp = (t - a) / (b - y);
	} 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.2d+77)) .or. (.not. (z <= 1.45d+64))) then
        tmp = (t - a) / (b - y)
    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.2e+77) || !(z <= 1.45e+64)) {
		tmp = (t - a) / (b - y);
	} 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.2e+77) or not (z <= 1.45e+64):
		tmp = (t - a) / (b - y)
	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.2e+77) || !(z <= 1.45e+64))
		tmp = Float64(Float64(t - a) / Float64(b - y));
	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.2e+77) || ~((z <= 1.45e+64)))
		tmp = (t - a) / (b - y);
	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.2e+77], N[Not[LessEqual[z, 1.45e+64]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $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.2 \cdot 10^{+77} \lor \neg \left(z \leq 1.45 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\

\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.2000000000000002e77 or 1.44999999999999997e64 < z

    1. Initial program 35.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-define35.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. +-commutative35.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-define35.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. Simplified35.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 90.9%

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

    if -3.2000000000000002e77 < z < 1.44999999999999997e64

    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. Recombined 2 regimes into one program.
  4. Final simplification89.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+77} \lor \neg \left(z \leq 1.45 \cdot 10^{+64}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \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 7: 71.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -0.64:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-149}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.640000000000000013 or 1.29999999999999992e-5 < z

    1. Initial program 46.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-define46.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. +-commutative46.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-define46.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. Simplified46.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 z around inf 85.1%

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

    if -0.640000000000000013 < z < -1.5000000000000001e-149

    1. Initial program 90.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-define90.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. +-commutative90.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-define90.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. Simplified90.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 0 75.3%

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

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

    if -1.5000000000000001e-149 < z < 1.29999999999999992e-5

    1. Initial program 89.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-define89.9%

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

      \[\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 y around inf 88.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \left(-\left(-1 \cdot \left(\frac{t}{y} - \frac{a}{y}\right) - x\right)\right)} \]
      3. div-sub63.9%

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

        \[\leadsto x + z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{t - a}{y} + \left(-x\right)\right)}\right) \]
      5. distribute-neg-in63.9%

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

        \[\leadsto x + z \cdot \left(\left(-\color{blue}{\left(-\frac{t - a}{y}\right)}\right) + \left(-\left(-x\right)\right)\right) \]
      7. remove-double-neg63.9%

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

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

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

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

Alternative 8: 71.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9000000000000001e-44 or 2.3e-5 < z

    1. Initial program 49.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-define50.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. +-commutative50.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-define50.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. Simplified50.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 84.2%

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

    if -2.9000000000000001e-44 < z < 2.3e-5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{t - a}{y} + \left(-x\right)\right)}\right) \]
      5. distribute-neg-in61.5%

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

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

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

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

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

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

Alternative 9: 53.3% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;y \leq 7 \cdot 10^{+62}:\\
\;\;\;\;\frac{t - a}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.4500000000000002e55 or 6.99999999999999967e62 < y

    1. Initial program 54.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-define54.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. +-commutative54.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-define54.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. Simplified54.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 y around inf 61.0%

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

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

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

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

    if -3.4500000000000002e55 < y < -3.4e-85

    1. Initial program 69.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-define69.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. +-commutative69.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-define69.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. Simplified69.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 69.9%

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

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

    if -3.4e-85 < y < 6.99999999999999967e62

    1. Initial program 76.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-define76.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. +-commutative76.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-define76.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. Simplified76.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 0 62.8%

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

Alternative 10: 62.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-149} \lor \neg \left(z \leq 2.4 \cdot 10^{-87}\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.5e-149) (not (<= z 2.4e-87))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.5e-149) || !(z <= 2.4e-87)) {
		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.5d-149)) .or. (.not. (z <= 2.4d-87))) 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.5e-149) || !(z <= 2.4e-87)) {
		tmp = (t - a) / (b - y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -1.5e-149) or not (z <= 2.4e-87):
		tmp = (t - a) / (b - y)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.5e-149) || !(z <= 2.4e-87))
		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.5e-149) || ~((z <= 2.4e-87)))
		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.5e-149], N[Not[LessEqual[z, 2.4e-87]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5000000000000001e-149 or 2.4e-87 < z

    1. Initial program 59.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-define59.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. +-commutative59.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-define59.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. Simplified59.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 73.4%

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

    if -1.5000000000000001e-149 < z < 2.4e-87

    1. Initial program 89.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-define89.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. +-commutative89.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-define89.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. Simplified89.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 z around 0 58.4%

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

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

Alternative 11: 44.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+55} \lor \neg \left(y \leq 3.7 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{x}{1 - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.04999999999999991e55 or 3.6999999999999999e-35 < y

    1. Initial program 56.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-define56.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. +-commutative56.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-define56.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. Simplified56.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 y around inf 53.9%

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

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

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

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

    if -2.04999999999999991e55 < y < 3.6999999999999999e-35

    1. Initial program 77.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-define77.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. +-commutative77.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-define77.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. Simplified77.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 z around inf 70.2%

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

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

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

Alternative 12: 44.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-44} \lor \neg \left(z \leq 3.7 \cdot 10^{-44}\right):\\
\;\;\;\;\frac{t}{b - y}\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.50000000000000008e-44 or 3.7e-44 < z

    1. Initial program 52.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-define52.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. +-commutative52.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-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 z around inf 80.7%

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

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

    if -7.50000000000000008e-44 < z < 3.7e-44

    1. Initial program 89.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-define89.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. +-commutative89.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-define89.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. Simplified89.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 y around inf 49.3%

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

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

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

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

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

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

Alternative 13: 32.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -23000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{-z}\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\


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

    1. Initial program 45.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-define45.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. +-commutative45.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-define45.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. Simplified45.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 y around inf 16.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z} \]
    10. Simplified16.1%

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

    if -23000 < z < 1

    1. Initial program 90.2%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. fma-define90.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. +-commutative90.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-define90.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. Simplified90.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 y around inf 43.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -23000 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;\frac{x}{-z}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 31.9% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-46} \lor \neg \left(z \leq 510000000000\right):\\
\;\;\;\;\frac{x}{-z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.8000000000000002e-46 or 5.1e11 < 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 y around inf 15.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z} \]
    10. Simplified15.1%

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

    if -9.8000000000000002e-46 < z < 5.1e11

    1. Initial program 89.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-define89.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. +-commutative89.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-define89.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. Simplified89.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 z around 0 46.1%

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

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

Alternative 15: 25.1% accurate, 17.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 67.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-define67.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. +-commutative67.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-define67.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. Simplified67.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 z around 0 22.9%

    \[\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 2024170 
(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)))))