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

Percentage Accurate: 89.1% → 97.3%
Time: 14.7s
Alternatives: 12
Speedup: 0.6×

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 12 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.1% 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: 97.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ t_2 := z \cdot t - x\\ t_3 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\ \mathbf{if}\;t\_3 \leq -2 \cdot 10^{+207}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{\mathsf{fma}\left(t, z, -x\right)}}{x + 1}\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+261}:\\ \;\;\;\;\left(\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)} + t\_1\right) + \frac{x}{t\_2 \cdot \left(-1 - x\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1 - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (+ x 1.0)))
        (t_2 (- (* z t) x))
        (t_3 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
   (if (<= t_3 -2e+207)
     (/ (+ x (* y (/ z (fma t z (- x))))) (+ x 1.0))
     (if (<= t_3 2e+261)
       (+ (+ (/ (* y z) (* t_2 (+ x 1.0))) t_1) (/ x (* t_2 (- -1.0 x))))
       (- t_1 (/ (- (/ x (* z (+ x 1.0))) (/ y (+ x 1.0))) t))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = (z * t) - x;
	double t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
	double tmp;
	if (t_3 <= -2e+207) {
		tmp = (x + (y * (z / fma(t, z, -x)))) / (x + 1.0);
	} else if (t_3 <= 2e+261) {
		tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x)));
	} else {
		tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x / Float64(x + 1.0))
	t_2 = Float64(Float64(z * t) - x)
	t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0))
	tmp = 0.0
	if (t_3 <= -2e+207)
		tmp = Float64(Float64(x + Float64(y * Float64(z / fma(t, z, Float64(-x))))) / Float64(x + 1.0));
	elseif (t_3 <= 2e+261)
		tmp = Float64(Float64(Float64(Float64(y * z) / Float64(t_2 * Float64(x + 1.0))) + t_1) + Float64(x / Float64(t_2 * Float64(-1.0 - x))));
	else
		tmp = Float64(t_1 - Float64(Float64(Float64(x / Float64(z * Float64(x + 1.0))) - Float64(y / Float64(x + 1.0))) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+207], N[(N[(x + N[(y * N[(z / N[(t * z + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+261], N[(N[(N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(x / N[(t$95$2 * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(N[(N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+207}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{\mathsf{fma}\left(t, z, -x\right)}}{x + 1}\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+261}:\\
\;\;\;\;\left(\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)} + t\_1\right) + \frac{x}{t\_2 \cdot \left(-1 - x\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -2.0000000000000001e207

    1. Initial program 62.7%

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

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

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

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

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

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

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

    if -2.0000000000000001e207 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 1.9999999999999999e261

    1. Initial program 98.9%

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

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

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

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

    if 1.9999999999999999e261 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 19.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq -2 \cdot 10^{+207}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{\mathsf{fma}\left(t, z, -x\right)}}{x + 1}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq 2 \cdot 10^{+261}:\\ \;\;\;\;\left(\frac{y \cdot z}{\left(z \cdot t - x\right) \cdot \left(x + 1\right)} + \frac{x}{x + 1}\right) + \frac{x}{\left(z \cdot t - x\right) \cdot \left(-1 - x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1} - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 94.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{x + 1}\\ t_2 := z \cdot t - x\\ \mathbf{if}\;z \leq -1.18 \cdot 10^{+196} \lor \neg \left(z \leq 2.3 \cdot 10^{+79}\right):\\ \;\;\;\;t\_1 - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)} + t\_1\right) + \frac{x}{t\_2 \cdot \left(-1 - x\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (+ x 1.0))) (t_2 (- (* z t) x)))
   (if (or (<= z -1.18e+196) (not (<= z 2.3e+79)))
     (- t_1 (/ (- (/ x (* z (+ x 1.0))) (/ y (+ x 1.0))) t))
     (+ (+ (/ (* y z) (* t_2 (+ x 1.0))) t_1) (/ x (* t_2 (- -1.0 x)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = (z * t) - x;
	double tmp;
	if ((z <= -1.18e+196) || !(z <= 2.3e+79)) {
		tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
	} else {
		tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x / (x + 1.0d0)
    t_2 = (z * t) - x
    if ((z <= (-1.18d+196)) .or. (.not. (z <= 2.3d+79))) then
        tmp = t_1 - (((x / (z * (x + 1.0d0))) - (y / (x + 1.0d0))) / t)
    else
        tmp = (((y * z) / (t_2 * (x + 1.0d0))) + t_1) + (x / (t_2 * ((-1.0d0) - x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (x + 1.0);
	double t_2 = (z * t) - x;
	double tmp;
	if ((z <= -1.18e+196) || !(z <= 2.3e+79)) {
		tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
	} else {
		tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x)));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (x + 1.0)
	t_2 = (z * t) - x
	tmp = 0
	if (z <= -1.18e+196) or not (z <= 2.3e+79):
		tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t)
	else:
		tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x)))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(x + 1.0))
	t_2 = Float64(Float64(z * t) - x)
	tmp = 0.0
	if ((z <= -1.18e+196) || !(z <= 2.3e+79))
		tmp = Float64(t_1 - Float64(Float64(Float64(x / Float64(z * Float64(x + 1.0))) - Float64(y / Float64(x + 1.0))) / t));
	else
		tmp = Float64(Float64(Float64(Float64(y * z) / Float64(t_2 * Float64(x + 1.0))) + t_1) + Float64(x / Float64(t_2 * Float64(-1.0 - x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (x + 1.0);
	t_2 = (z * t) - x;
	tmp = 0.0;
	if ((z <= -1.18e+196) || ~((z <= 2.3e+79)))
		tmp = t_1 - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / t);
	else
		tmp = (((y * z) / (t_2 * (x + 1.0))) + t_1) + (x / (t_2 * (-1.0 - x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[Or[LessEqual[z, -1.18e+196], N[Not[LessEqual[z, 2.3e+79]], $MachinePrecision]], N[(t$95$1 - N[(N[(N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(x / N[(t$95$2 * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{+196} \lor \neg \left(z \leq 2.3 \cdot 10^{+79}\right):\\
\;\;\;\;t\_1 - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.1800000000000001e196 or 2.3e79 < z

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1800000000000001e196 < z < 2.3e79

    1. Initial program 98.8%

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

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

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

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

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

Alternative 3: 94.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+195} \lor \neg \left(z \leq 1.2 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.3000000000000001e195 or 1.19999999999999998e85 < z

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e195 < z < 1.19999999999999998e85

    1. Initial program 98.8%

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

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

Alternative 4: 68.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{x + 1}\\

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

\mathbf{elif}\;x \leq 1450000:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+31}:\\
\;\;\;\;1 + \frac{-1 + \frac{y}{t}}{x}\\

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


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

    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. Add Preprocessing
    5. Taylor expanded in t around inf 78.0%

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified78.0%

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

    if -6.49999999999999966e-103 < x < 8.7999999999999995e-79

    1. Initial program 84.3%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Taylor expanded in x around 0 61.1%

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

    if 8.7999999999999995e-79 < x < 1.45e6

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{y \cdot \frac{z}{x}}\right) \]
      3. distribute-lft-neg-in53.3%

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

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

    if 1.45e6 < x < 4.19999999999999958e31

    1. Initial program 59.3%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Taylor expanded in x around -inf 75.2%

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

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

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

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

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{y}{t}}}{x} \]
    8. Simplified75.2%

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

    if 4.19999999999999958e31 < x

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification73.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-103}:\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 1450000:\\ \;\;\;\;1 - y \cdot \frac{z}{x}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+31}:\\ \;\;\;\;1 + \frac{-1 + \frac{y}{t}}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 94.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+196} \lor \neg \left(z \leq 6.4 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e196 or 6.4000000000000003e72 < z

    1. Initial program 59.1%

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

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

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

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

    if -2.9e196 < z < 6.4000000000000003e72

    1. Initial program 98.8%

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

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

Alternative 6: 83.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-83} \lor \neg \left(t \leq 1.6 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.49999999999999938e-83 or 1.6e-12 < t

    1. Initial program 84.4%

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

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

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

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

    if -8.49999999999999938e-83 < t < 1.6e-12

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.64999999999999993e-86 or 4.49999999999999981e-12 < t

    1. Initial program 84.4%

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

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

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

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

    if -1.64999999999999993e-86 < t < 4.49999999999999981e-12

    1. Initial program 94.1%

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

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

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

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

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

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

        \[\leadsto 1 + z \cdot \color{blue}{\frac{y}{-x \cdot \left(1 + x\right)}} \]
      3. distribute-rgt-neg-in79.3%

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

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

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

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

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

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

Alternative 8: 78.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-86} \lor \neg \left(t \leq 6.2 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.4999999999999996e-86 or 6.2000000000000002e-12 < t

    1. Initial program 84.4%

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

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

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

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

    if -9.4999999999999996e-86 < t < 6.2000000000000002e-12

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + \left(-\color{blue}{y \cdot \frac{z}{x}}\right) \]
      3. distribute-lft-neg-in66.9%

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

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

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

Alternative 9: 67.7% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.99999999999999977e-7 or 3.10000000000000007e-75 < x

    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. Add Preprocessing
    5. Taylor expanded in y around inf 85.9%

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

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

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

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

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

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

    if -4.99999999999999977e-7 < x < -4.99999999999999983e-106

    1. Initial program 92.1%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified48.3%

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

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

    if -4.99999999999999983e-106 < x < 3.10000000000000007e-75

    1. Initial program 84.3%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Taylor expanded in x around 0 61.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-7}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-106}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-75}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{-107} \lor \neg \left(x \leq 2.15 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.8000000000000005e-107 or 2.14999999999999991e-79 < x

    1. Initial program 89.6%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified78.2%

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

    if -8.8000000000000005e-107 < x < 2.14999999999999991e-79

    1. Initial program 84.3%

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

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

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1} \]
    6. Taylor expanded in x around 0 61.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{-107} \lor \neg \left(x \leq 2.15 \cdot 10^{-79}\right):\\ \;\;\;\;\frac{x}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 55.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.000115:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -0.000115) 1.0 (if (<= x 6.2e-25) x 1.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -0.000115) {
		tmp = 1.0;
	} else if (x <= 6.2e-25) {
		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 <= (-0.000115d0)) then
        tmp = 1.0d0
    else if (x <= 6.2d-25) 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 <= -0.000115) {
		tmp = 1.0;
	} else if (x <= 6.2e-25) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -0.000115:
		tmp = 1.0
	elif x <= 6.2e-25:
		tmp = x
	else:
		tmp = 1.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -0.000115)
		tmp = 1.0;
	elseif (x <= 6.2e-25)
		tmp = x;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -0.000115)
		tmp = 1.0;
	elseif (x <= 6.2e-25)
		tmp = x;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.000115], 1.0, If[LessEqual[x, 6.2e-25], x, 1.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000115:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e-4 or 6.19999999999999989e-25 < 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. Add Preprocessing
    5. Taylor expanded in y around inf 86.9%

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

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

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

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

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

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

    if -1.15e-4 < x < 6.19999999999999989e-25

    1. Initial program 86.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.000115:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 53.3% 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 87.6%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  10. Final simplification49.7%

    \[\leadsto 1 \]
  11. Add Preprocessing

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 2024044 
(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)))