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

Percentage Accurate: 88.9% → 96.4%
Time: 12.2s
Alternatives: 8
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 8 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: 88.9% 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: 96.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+249}:\\
\;\;\;\;t\_1\\

\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))) < -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 51.8%

      \[\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-frac84.0%

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

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

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

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

    1. Initial program 99.1%

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

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

    1. Initial program 40.2%

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

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

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

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

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

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

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

Alternative 2: 83.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-137} \lor \neg \left(t \leq 4.4 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{\frac{y}{x + 1}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5e-137 or 4.40000000000000037e-53 < t

    1. Initial program 91.0%

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

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

      \[\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. +-commutative81.1%

        \[\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-neg81.1%

        \[\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-neg81.1%

        \[\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. +-commutative81.1%

        \[\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-neg81.1%

        \[\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-neg81.1%

        \[\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-frac281.1%

        \[\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-in81.1%

        \[\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-eval81.1%

        \[\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-neg81.1%

        \[\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-neg81.1%

        \[\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-neg81.1%

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

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

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

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

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

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

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

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

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

    if -2.5e-137 < t < 4.40000000000000037e-53

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 83.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{-139} \lor \neg \left(t \leq 4 \cdot 10^{-53}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \frac{\frac{z}{x}}{-1 - x}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -5.6e-139) (not (<= t 4e-53)))
   (/ (+ 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 <= -5.6e-139) || !(t <= 4e-53)) {
		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 <= (-5.6d-139)) .or. (.not. (t <= 4d-53))) 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 <= -5.6e-139) || !(t <= 4e-53)) {
		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 <= -5.6e-139) or not (t <= 4e-53):
		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 <= -5.6e-139) || !(t <= 4e-53))
		tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0));
	else
		tmp = Float64(1.0 + Float64(y * Float64(Float64(z / x) / Float64(-1.0 - x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -5.6e-139) || ~((t <= 4e-53)))
		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, -5.6e-139], N[Not[LessEqual[t, 4e-53]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(N[(z / x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-139} \lor \neg \left(t \leq 4 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.5999999999999997e-139 or 4.00000000000000012e-53 < t

    1. Initial program 91.0%

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

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

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

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

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

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

    if -5.5999999999999997e-139 < t < 4.00000000000000012e-53

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.30000000000000008e-137 or 7.1999999999999998e-53 < t

    1. Initial program 91.0%

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

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

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

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

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

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

    if -2.30000000000000008e-137 < t < 7.1999999999999998e-53

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} - \frac{y \cdot \frac{z}{x}}{1 + x} \]
      9. associate-*r/84.4%

        \[\leadsto 1 - \frac{\color{blue}{\frac{y \cdot z}{x}}}{1 + x} \]
      10. associate-/r*84.3%

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

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

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

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

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

Alternative 5: 78.1% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.79999999999999985e38 or 2.2e67 < x

    1. Initial program 92.2%

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

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

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

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

    if -1.79999999999999985e38 < x < 2.2e67

    1. Initial program 91.4%

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

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

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

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

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

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

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

Alternative 6: 67.9% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 91.9%

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

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

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

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

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

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

    if -1.44999999999999992e-132 < x < 2.3499999999999999e-15

    1. Initial program 91.9%

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

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

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

    if 2.3499999999999999e-15 < x

    1. Initial program 91.3%

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

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

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

Alternative 7: 67.8% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 91.2%

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

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

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

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

    if -0.660000000000000031 < x < 5.20000000000000009e-15

    1. Initial program 92.3%

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

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

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

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

Alternative 8: 53.5% 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 91.7%

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

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

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