Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A

Percentage Accurate: 89.3% → 98.7%
Time: 11.7s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 89.3% accurate, 1.0× speedup?

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

\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}

Alternative 1: 98.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9e59 or 1.08000000000000004e55 < z

    1. Initial program 75.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative75.6%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 74.7%

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t \cdot z - x}{z}}}}{x + 1} \]
    7. Taylor expanded in t around 0 98.2%

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

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

        \[\leadsto \frac{x + \frac{y}{\color{blue}{t - \frac{x}{z}}}}{x + 1} \]
    9. Simplified98.2%

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

    if -1.9e59 < z < 1.08000000000000004e55

    1. Initial program 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+59} \lor \neg \left(z \leq 1.08 \cdot 10^{+55}\right):\\ \;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\\ \end{array} \]

Alternative 2: 97.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot z - x\\
\mathbf{if}\;t \leq -1 \cdot 10^{+126}:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{1}{t} - \frac{x}{t_1}\right)}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.99999999999999925e125

    1. Initial program 70.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative70.3%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub70.3%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity70.3%

        \[\leadsto \frac{x + \left(\frac{y \cdot z}{\color{blue}{1 \cdot \left(z \cdot t - x\right)}} - \frac{x}{z \cdot t - x}\right)}{x + 1} \]
      3. times-frac85.6%

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr85.6%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef85.6%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity85.6%

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

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

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

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

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

    if -9.99999999999999925e125 < t

    1. Initial program 93.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative93.3%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub93.3%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity93.3%

        \[\leadsto \frac{x + \left(\frac{y \cdot z}{\color{blue}{1 \cdot \left(z \cdot t - x\right)}} - \frac{x}{z \cdot t - x}\right)}{x + 1} \]
      3. times-frac98.6%

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr98.6%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef98.6%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity98.6%

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

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

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

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{\frac{1}{\frac{t \cdot z - x}{x}}}\right)}{x + 1} \]
      2. inv-pow98.6%

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{t \cdot z - x}{x}\right)}^{-1}}\right)}{x + 1} \]
      3. *-commutative98.6%

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - {\left(\frac{\color{blue}{z \cdot t} - x}{x}\right)}^{-1}\right)}{x + 1} \]
    9. Applied egg-rr98.6%

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{z \cdot t - x}{x}\right)}^{-1}}\right)}{x + 1} \]
    10. Step-by-step derivation
      1. unpow-198.6%

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \frac{1}{\color{blue}{\frac{z \cdot t}{x} - \frac{x}{x}}}\right)}{x + 1} \]
      3. *-commutative98.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+126}:\\ \;\;\;\;\frac{x + \left(y \cdot \frac{1}{t} - \frac{x}{t \cdot z - x}\right)}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \left(y \cdot \frac{z}{t \cdot z - x} + \frac{-1}{\frac{t}{\frac{x}{z}} + -1}\right)}{x + 1}\\ \end{array} \]

Alternative 3: 97.7% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{z}{t_1} - t_2\right)}{x + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000025e116

    1. Initial program 70.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative70.3%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub70.3%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity70.3%

        \[\leadsto \frac{x + \left(\frac{y \cdot z}{\color{blue}{1 \cdot \left(z \cdot t - x\right)}} - \frac{x}{z \cdot t - x}\right)}{x + 1} \]
      3. times-frac85.6%

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr85.6%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef85.6%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity85.6%

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

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

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

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

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

    if -5.00000000000000025e116 < t

    1. Initial program 93.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative93.3%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub93.3%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity93.3%

        \[\leadsto \frac{x + \left(\frac{y \cdot z}{\color{blue}{1 \cdot \left(z \cdot t - x\right)}} - \frac{x}{z \cdot t - x}\right)}{x + 1} \]
      3. times-frac98.6%

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr98.6%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef98.6%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity98.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+116}:\\ \;\;\;\;\frac{x + \left(y \cdot \frac{1}{t} - \frac{x}{t \cdot z - x}\right)}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \frac{x}{t \cdot z - x}\right)}{x + 1}\\ \end{array} \]

Alternative 4: 90.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-167} \lor \neg \left(z \leq 4.1 \cdot 10^{-178}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.64999999999999998e-167 or 4.0999999999999999e-178 < z

    1. Initial program 87.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.4%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 83.8%

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t \cdot z - x}{z}}}}{x + 1} \]
    7. Taylor expanded in t around 0 96.0%

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

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

        \[\leadsto \frac{x + \frac{y}{\color{blue}{t - \frac{x}{z}}}}{x + 1} \]
    9. Simplified96.0%

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

    if -1.64999999999999998e-167 < z < 4.0999999999999999e-178

    1. Initial program 99.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative99.8%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub99.8%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity99.8%

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

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr99.9%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - {\left(\frac{\color{blue}{z \cdot t} - x}{x}\right)}^{-1}\right)}{x + 1} \]
    9. Applied egg-rr99.9%

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{z \cdot t - x}{x}\right)}^{-1}}\right)}{x + 1} \]
    10. Step-by-step derivation
      1. unpow-199.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{-167} \lor \neg \left(z \leq 4.1 \cdot 10^{-178}\right):\\ \;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{-1}{-1 + \frac{t \cdot z}{x}}}{x + 1}\\ \end{array} \]

Alternative 5: 89.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-247} \lor \neg \left(z \leq 8 \cdot 10^{-233}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.40000000000000011e-247 or 7.99999999999999966e-233 < z

    1. Initial program 89.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.1%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 81.7%

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

        \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t \cdot z - x}{z}}}}{x + 1} \]
    6. Simplified89.2%

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t \cdot z - x}{z}}}}{x + 1} \]
    7. Taylor expanded in t around 0 92.1%

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

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

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

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

    if -2.40000000000000011e-247 < z < 7.99999999999999966e-233

    1. Initial program 100.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative100.0%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around 0 100.0%

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

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

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

        \[\leadsto \frac{1 + \left(x - \frac{\color{blue}{z \cdot y}}{x}\right)}{1 + x} \]
      4. +-commutative100.0%

        \[\leadsto \frac{1 + \left(x - \frac{z \cdot y}{x}\right)}{\color{blue}{x + 1}} \]
    6. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-247} \lor \neg \left(z \leq 8 \cdot 10^{-233}\right):\\ \;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - \frac{y \cdot z}{x}\right)}{x + 1}\\ \end{array} \]

Alternative 6: 90.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-168} \lor \neg \left(z \leq 2.25 \cdot 10^{-180}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.09999999999999994e-168 or 2.25000000000000005e-180 < z

    1. Initial program 87.4%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.4%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 83.8%

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t \cdot z - x}{z}}}}{x + 1} \]
    7. Taylor expanded in t around 0 96.0%

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

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

        \[\leadsto \frac{x + \frac{y}{\color{blue}{t - \frac{x}{z}}}}{x + 1} \]
    9. Simplified96.0%

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

    if -2.09999999999999994e-168 < z < 2.25000000000000005e-180

    1. Initial program 99.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative99.8%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around 0 93.5%

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

        \[\leadsto \frac{x - \frac{x}{t \cdot z - x}}{\color{blue}{x + 1}} \]
    6. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-168} \lor \neg \left(z \leq 2.25 \cdot 10^{-180}\right):\\ \;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \frac{x}{t \cdot z - x}}{x + 1}\\ \end{array} \]

Alternative 7: 77.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -17:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq 25000000000:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -17.0)
   (- 1.0 (* (/ z x) (/ y x)))
   (if (<= x 25000000000.0) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (/ -1.0 x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -17.0) {
		tmp = 1.0 - ((z / x) * (y / x));
	} else if (x <= 25000000000.0) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-17.0d0)) then
        tmp = 1.0d0 - ((z / x) * (y / x))
    else if (x <= 25000000000.0d0) then
        tmp = (x + (y / t)) / (x + 1.0d0)
    else
        tmp = 1.0d0 + ((-1.0d0) / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -17.0) {
		tmp = 1.0 - ((z / x) * (y / x));
	} else if (x <= 25000000000.0) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -17.0:
		tmp = 1.0 - ((z / x) * (y / x))
	elif x <= 25000000000.0:
		tmp = (x + (y / t)) / (x + 1.0)
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -17.0)
		tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x)));
	elseif (x <= 25000000000.0)
		tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0));
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -17.0)
		tmp = 1.0 - ((z / x) * (y / x));
	elseif (x <= 25000000000.0)
		tmp = (x + (y / t)) / (x + 1.0);
	else
		tmp = 1.0 + (-1.0 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -17.0], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 25000000000.0], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -17:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\

\mathbf{elif}\;x \leq 25000000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -17

    1. Initial program 92.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.3%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in x around -inf 82.6%

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

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--82.6%

        \[\leadsto 1 - \frac{\color{blue}{z \cdot \left(y - t\right)}}{{x}^{2}} \]
      4. unpow282.6%

        \[\leadsto 1 - \frac{z \cdot \left(y - t\right)}{\color{blue}{x \cdot x}} \]
      5. times-frac86.8%

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified86.8%

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

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

    if -17 < x < 2.5e10

    1. Initial program 89.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.1%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 66.4%

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

    if 2.5e10 < x

    1. Initial program 90.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.5%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 98.4%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified98.4%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
    7. Taylor expanded in x around inf 98.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -17:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq 25000000000:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 8: 77.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.38 \cdot 10^{-8}:\\
\;\;\;\;\frac{x - \frac{y}{\frac{x}{z}}}{x + 1}\\

\mathbf{elif}\;x \leq 12500000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


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

    1. Initial program 92.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 91.4%

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t \cdot z - x}{z}}}}{x + 1} \]
    7. Taylor expanded in t around 0 89.5%

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

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

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

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

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

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

    if -1.37999999999999995e-8 < x < 1.25e10

    1. Initial program 88.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.9%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 67.4%

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

    if 1.25e10 < x

    1. Initial program 90.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.5%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 98.4%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified98.4%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
    7. Taylor expanded in x around inf 98.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.38 \cdot 10^{-8}:\\ \;\;\;\;\frac{x - \frac{y}{\frac{x}{z}}}{x + 1}\\ \mathbf{elif}\;x \leq 12500000000:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 9: 68.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.3 \cdot 10^{-55} \lor \neg \left(x \leq 2.6 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.2999999999999997e-55 or 2.6e-18 < x

    1. Initial program 90.2%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.2%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 88.9%

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative88.9%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified88.9%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -6.2999999999999997e-55 < x < 2.6e-18

    1. Initial program 90.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.6%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 48.9%

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

      \[\leadsto \color{blue}{\frac{y}{t \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. distribute-lft-in45.8%

        \[\leadsto \frac{y}{\color{blue}{t \cdot 1 + t \cdot x}} \]
      2. *-rgt-identity45.8%

        \[\leadsto \frac{y}{\color{blue}{t} + t \cdot x} \]
    7. Simplified45.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.3 \cdot 10^{-55} \lor \neg \left(x \leq 2.6 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t + t \cdot x}\\ \end{array} \]

Alternative 10: 67.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-5}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.7499999999999998e-5

    1. Initial program 92.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.3%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in x around -inf 82.6%

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

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

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--82.6%

        \[\leadsto 1 - \frac{\color{blue}{z \cdot \left(y - t\right)}}{{x}^{2}} \]
      4. unpow282.6%

        \[\leadsto 1 - \frac{z \cdot \left(y - t\right)}{\color{blue}{x \cdot x}} \]
      5. times-frac86.8%

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified86.8%

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

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

    if -1.7499999999999998e-5 < x < 3.3999999999999998e-17

    1. Initial program 90.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.1%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub90.1%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity90.1%

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

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr93.7%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef93.7%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity93.7%

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

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

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

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

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{t \cdot z - x}{x}\right)}^{-1}}\right)}{x + 1} \]
      3. *-commutative93.7%

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - {\left(\frac{\color{blue}{z \cdot t} - x}{x}\right)}^{-1}\right)}{x + 1} \]
    9. Applied egg-rr93.7%

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{z \cdot t - x}{x}\right)}^{-1}}\right)}{x + 1} \]
    10. Step-by-step derivation
      1. unpow-193.7%

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

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

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

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

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

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

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

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

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

    if 3.3999999999999998e-17 < x

    1. Initial program 88.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.6%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 94.1%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified94.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-5}:\\ \;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-17}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]

Alternative 11: 68.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-54} \lor \neg \left(x \leq 2.8 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.74999999999999991e-54 or 2.80000000000000012e-18 < x

    1. Initial program 90.2%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.2%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 88.9%

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative88.9%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified88.9%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]

    if -1.74999999999999991e-54 < x < 2.80000000000000012e-18

    1. Initial program 90.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.6%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub90.6%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity90.6%

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

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr93.4%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef93.4%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity93.4%

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

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

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

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

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{t \cdot z - x}{x}\right)}^{-1}}\right)}{x + 1} \]
      3. *-commutative93.4%

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

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{z \cdot t - x}{x}\right)}^{-1}}\right)}{x + 1} \]
    10. Step-by-step derivation
      1. unpow-193.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-54} \lor \neg \left(x \leq 2.8 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t}\\ \end{array} \]

Alternative 12: 67.4% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 5.2 \cdot 10^{-64}:\\
\;\;\;\;\frac{y}{t}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3499999999999999e-5 or 5.2e-64 < x

    1. Initial program 90.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.6%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub90.6%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity90.6%

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

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr99.4%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef99.4%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity99.4%

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

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

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

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

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

    if -1.3499999999999999e-5 < x < 5.2e-64

    1. Initial program 89.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.9%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub89.9%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity89.9%

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

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr93.0%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef93.0%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity93.0%

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

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

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

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

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{t \cdot z - x}{x}\right)}^{-1}}\right)}{x + 1} \]
      3. *-commutative93.0%

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - {\left(\frac{\color{blue}{z \cdot t} - x}{x}\right)}^{-1}\right)}{x + 1} \]
    9. Applied egg-rr93.0%

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \color{blue}{{\left(\frac{z \cdot t - x}{x}\right)}^{-1}}\right)}{x + 1} \]
    10. Step-by-step derivation
      1. unpow-193.0%

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

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

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

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

        \[\leadsto \frac{x + \left(y \cdot \frac{z}{t \cdot z - x} - \frac{1}{\color{blue}{\frac{t}{\frac{x}{z}}} + \left(-\frac{x}{x}\right)}\right)}{x + 1} \]
      6. *-inverses93.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-64}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 54.1% accurate, 3.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-7}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-216}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -6e-7) 1.0 (if (<= x 1.45e-216) x 1.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6e-7) {
		tmp = 1.0;
	} else if (x <= 1.45e-216) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-6d-7)) then
        tmp = 1.0d0
    else if (x <= 1.45d-216) then
        tmp = x
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6e-7) {
		tmp = 1.0;
	} else if (x <= 1.45e-216) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -6e-7:
		tmp = 1.0
	elif x <= 1.45e-216:
		tmp = x
	else:
		tmp = 1.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -6e-7)
		tmp = 1.0;
	elseif (x <= 1.45e-216)
		tmp = x;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -6e-7)
		tmp = 1.0;
	elseif (x <= 1.45e-216)
		tmp = x;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -6e-7], 1.0, If[LessEqual[x, 1.45e-216], x, 1.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-7}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 1.45 \cdot 10^{-216}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.9999999999999997e-7 or 1.45e-216 < x

    1. Initial program 90.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative90.5%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Step-by-step derivation
      1. div-sub90.5%

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      2. *-un-lft-identity90.5%

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

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

        \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    5. Applied egg-rr99.0%

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    6. Step-by-step derivation
      1. fma-udef99.0%

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

        \[\leadsto \frac{x + \color{blue}{\left(\frac{y}{1} \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
      3. /-rgt-identity99.0%

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

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

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

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

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

    if -5.9999999999999997e-7 < x < 1.45e-216

    1. Initial program 89.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.9%

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

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 28.7%

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative28.7%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified28.7%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
    7. Taylor expanded in x around 0 28.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-7}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-216}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 14: 53.1% accurate, 17.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 90.4%

    \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
  2. Step-by-step derivation
    1. *-commutative90.4%

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

    \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
  4. Step-by-step derivation
    1. div-sub90.4%

      \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}}{x + 1} \]
    2. *-un-lft-identity90.4%

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

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

      \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
  5. Applied egg-rr96.9%

    \[\leadsto \frac{x + \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{z}{z \cdot t - x}, -\frac{x}{z \cdot t - x}\right)}}{x + 1} \]
  6. Step-by-step derivation
    1. fma-udef96.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  9. Final simplification57.7%

    \[\leadsto 1 \]

Developer target: 99.5% accurate, 0.8× speedup?

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

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

Reproduce

?
herbie shell --seed 2023290 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

  (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))