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

Percentage Accurate: 89.5% → 98.2%
Time: 12.7s
Alternatives: 9
Speedup: 0.3×

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 9 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.5% 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.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t - x\\ t_2 := \frac{x - \frac{x - y \cdot z}{t\_1}}{x + 1}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+230}:\\ \;\;\;\;\frac{y \cdot \left(\frac{z}{x - z \cdot t} + \frac{\frac{x}{t\_1} - x}{y}\right)}{-1 - x}\\ \mathbf{elif}\;t\_2 \leq 10^{+52}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{y}{\left(x + 1\right) \cdot \frac{t\_1}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x \cdot \left(1 + \frac{1}{x}\right)} + \frac{\frac{y}{x + 1} + \frac{\frac{x}{z}}{-1 - x}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* z t) x)) (t_2 (/ (- x (/ (- x (* y z)) t_1)) (+ x 1.0))))
   (if (<= t_2 -2e+230)
     (/ (* y (+ (/ z (- x (* z t))) (/ (- (/ x t_1) x) y))) (- -1.0 x))
     (if (<= t_2 1e+52)
       t_2
       (if (<= t_2 INFINITY)
         (/ y (* (+ x 1.0) (/ t_1 z)))
         (+
          (/ x (* x (+ 1.0 (/ 1.0 x))))
          (/ (+ (/ y (+ x 1.0)) (/ (/ x z) (- -1.0 x))) t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double t_2 = (x - ((x - (y * z)) / t_1)) / (x + 1.0);
	double tmp;
	if (t_2 <= -2e+230) {
		tmp = (y * ((z / (x - (z * t))) + (((x / t_1) - x) / y))) / (-1.0 - x);
	} else if (t_2 <= 1e+52) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = y / ((x + 1.0) * (t_1 / z));
	} else {
		tmp = (x / (x * (1.0 + (1.0 / x)))) + (((y / (x + 1.0)) + ((x / z) / (-1.0 - x))) / t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (z * t) - x;
	double t_2 = (x - ((x - (y * z)) / t_1)) / (x + 1.0);
	double tmp;
	if (t_2 <= -2e+230) {
		tmp = (y * ((z / (x - (z * t))) + (((x / t_1) - x) / y))) / (-1.0 - x);
	} else if (t_2 <= 1e+52) {
		tmp = t_2;
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = y / ((x + 1.0) * (t_1 / z));
	} else {
		tmp = (x / (x * (1.0 + (1.0 / x)))) + (((y / (x + 1.0)) + ((x / z) / (-1.0 - x))) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z * t) - x
	t_2 = (x - ((x - (y * z)) / t_1)) / (x + 1.0)
	tmp = 0
	if t_2 <= -2e+230:
		tmp = (y * ((z / (x - (z * t))) + (((x / t_1) - x) / y))) / (-1.0 - x)
	elif t_2 <= 1e+52:
		tmp = t_2
	elif t_2 <= math.inf:
		tmp = y / ((x + 1.0) * (t_1 / z))
	else:
		tmp = (x / (x * (1.0 + (1.0 / x)))) + (((y / (x + 1.0)) + ((x / z) / (-1.0 - x))) / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z * t) - x)
	t_2 = Float64(Float64(x - Float64(Float64(x - Float64(y * z)) / t_1)) / Float64(x + 1.0))
	tmp = 0.0
	if (t_2 <= -2e+230)
		tmp = Float64(Float64(y * Float64(Float64(z / Float64(x - Float64(z * t))) + Float64(Float64(Float64(x / t_1) - x) / y))) / Float64(-1.0 - x));
	elseif (t_2 <= 1e+52)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(t_1 / z)));
	else
		tmp = Float64(Float64(x / Float64(x * Float64(1.0 + Float64(1.0 / x)))) + Float64(Float64(Float64(y / Float64(x + 1.0)) + Float64(Float64(x / z) / Float64(-1.0 - x))) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z * t) - x;
	t_2 = (x - ((x - (y * z)) / t_1)) / (x + 1.0);
	tmp = 0.0;
	if (t_2 <= -2e+230)
		tmp = (y * ((z / (x - (z * t))) + (((x / t_1) - x) / y))) / (-1.0 - x);
	elseif (t_2 <= 1e+52)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = y / ((x + 1.0) * (t_1 / z));
	else
		tmp = (x / (x * (1.0 + (1.0 / x)))) + (((y / (x + 1.0)) + ((x / z) / (-1.0 - x))) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+230], N[(N[(y * N[(N[(z / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x / t$95$1), $MachinePrecision] - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+52], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x / z), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 10^{+52}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -2.0000000000000002e230

    1. Initial program 63.8%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified63.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 -inf 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.9999999999999999e51

    1. Initial program 98.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 9.9999999999999999e51 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0

    1. Initial program 52.6%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified52.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 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 0.0%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified0.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 99.8%

      \[\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. +-commutative99.8%

        \[\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-neg99.8%

        \[\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-neg99.8%

        \[\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. +-commutative99.8%

        \[\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} \]
    7. Simplified99.8%

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

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

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

Alternative 2: 95.7% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot \left(1 + \frac{1}{x}\right)} + \frac{\frac{y}{x + 1} + \frac{\frac{x}{z}}{-1 - x}}{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 #s(literal 1 binary64))) < 9.9999999999999999e51

    1. Initial program 95.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 9.9999999999999999e51 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0

    1. Initial program 52.6%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified52.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 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 0.0%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified0.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 99.8%

      \[\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. +-commutative99.8%

        \[\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-neg99.8%

        \[\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-neg99.8%

        \[\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. +-commutative99.8%

        \[\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} \]
    7. Simplified99.8%

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

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

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

Alternative 3: 95.7% accurate, 0.3× speedup?

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

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

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

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


\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 #s(literal 1 binary64))) < 9.9999999999999999e51

    1. Initial program 95.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Add Preprocessing

    if 9.9999999999999999e51 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0

    1. Initial program 52.6%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified52.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 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 4: 80.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6e-47 or 3.40000000000000006e-199 < t

    1. Initial program 87.2%

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

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

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

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

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

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

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

    if -1.6e-47 < t < 3.40000000000000006e-199

    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. Step-by-step derivation
      1. clear-num89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}} \]
    12. Step-by-step derivation
      1. div-sub83.3%

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

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

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

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

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

        \[\leadsto \color{blue}{1} - \frac{y \cdot \frac{z}{x}}{x + 1} \]
    13. Applied egg-rr83.3%

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

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

Alternative 5: 77.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 2.35 \cdot 10^{+23}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.49999999999999991e-14 or 2.3499999999999999e23 < x

    1. Initial program 88.3%

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

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

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

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

    if -5.49999999999999991e-14 < x < 2.3499999999999999e23

    1. Initial program 87.3%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.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 74.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-14}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{+23}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 5.8 \cdot 10^{-38}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\

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


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

    1. Initial program 87.8%

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

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

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

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

    if -1.30000000000000002e-15 < x < 5.79999999999999988e-38

    1. Initial program 86.7%

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

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified86.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 47.9%

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

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

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

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

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

    if 5.79999999999999988e-38 < x

    1. Initial program 89.4%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified84.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{-15}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-38}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.3% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 87.8%

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

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

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

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

    if -2.39999999999999995e-15 < x < 2.7000000000000001e-39

    1. Initial program 86.7%

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

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

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

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

    if 2.7000000000000001e-39 < x

    1. Initial program 89.4%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    7. Simplified84.5%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 68.3% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5499999999999999e-15 or 1.70000000000000007e-50 < x

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

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

    if -1.5499999999999999e-15 < x < 1.70000000000000007e-50

    1. Initial program 86.4%

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

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

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

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

Alternative 9: 54.7% 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.8%

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

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

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

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

Developer Target 1: 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 2024182 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

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