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

Percentage Accurate: 89.0% → 94.8%
Time: 8.7s
Alternatives: 9
Speedup: 0.5×

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.0% 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: 94.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{+281}:\\ \;\;\;\;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 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
   (if (<= t_1 2e+281) t_1 (/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if (t_1 <= 2e+281) {
		tmp = t_1;
	} else {
		tmp = (x + (y / t)) / (x + 1.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
    if (t_1 <= 2d+281) then
        tmp = t_1
    else
        tmp = (x + (y / t)) / (x + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	double tmp;
	if (t_1 <= 2e+281) {
		tmp = t_1;
	} else {
		tmp = (x + (y / t)) / (x + 1.0);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)
	tmp = 0
	if t_1 <= 2e+281:
		tmp = t_1
	else:
		tmp = (x + (y / t)) / (x + 1.0)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0))
	tmp = 0.0
	if (t_1 <= 2e+281)
		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 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
	tmp = 0.0;
	if (t_1 <= 2e+281)
		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[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+281], 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{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 98.6%

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

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

    1. Initial program 12.3%

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

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

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

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

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

Alternative 2: 64.8% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;x \leq 1.18 \cdot 10^{-57}:\\
\;\;\;\;1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.20000000000000021e-151 or 6.2e-202 < x < 1.18e-57 or 4.19999999999999979e94 < x

    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. Taylor expanded in y around 0 84.6%

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

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

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

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

    if -3.20000000000000021e-151 < x < 6.2e-202

    1. Initial program 93.1%

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

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

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

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

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

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

    if 1.18e-57 < x < 1.0499999999999999e-20

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if 1.0499999999999999e-20 < x < 4.19999999999999979e94

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 - \frac{y \cdot z}{{x}^{2}}} \]
    8. Step-by-step derivation
      1. unpow274.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{-151}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-202}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 1.18 \cdot 10^{-57}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+94}:\\ \;\;\;\;1 - \frac{y \cdot z}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 3: 77.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 81.8%

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

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

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

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

    if -1.08e21 < z < 1.29999999999999992e-5

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 78.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 80.3%

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

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

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

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

    if -7.2e90 < z < 0.0210000000000000013

    1. Initial program 99.3%

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

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

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

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

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

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

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

Alternative 5: 74.5% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

    if -3.8000000000000001e-122 < x < 2.0499999999999999e34

    1. Initial program 95.5%

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

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

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

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

    if 2.0499999999999999e34 < x

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 68.3% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.30000000000000019e-122 or 4.59999999999999999e-21 < x

    1. Initial program 90.4%

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

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

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

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

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

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

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

    if -4.30000000000000019e-122 < x < 4.59999999999999999e-21

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot z - x}} \]
    9. Step-by-step derivation
      1. *-commutative54.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{-122}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-21}:\\ \;\;\;\;\frac{y \cdot z}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 7: 75.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-121}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-20}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -1.05e-121) 1.0 (if (<= x 9e-20) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -1.05e-121) {
		tmp = 1.0;
	} else if (x <= 9e-20) {
		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.05d-121)) then
        tmp = 1.0d0
    else if (x <= 9d-20) 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.05e-121) {
		tmp = 1.0;
	} else if (x <= 9e-20) {
		tmp = (x + (y / t)) / (x + 1.0);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -1.05e-121:
		tmp = 1.0
	elif x <= 9e-20:
		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.05e-121)
		tmp = 1.0;
	elseif (x <= 9e-20)
		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.05e-121)
		tmp = 1.0;
	elseif (x <= 9e-20)
		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.05e-121], 1.0, If[LessEqual[x, 9e-20], 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.05 \cdot 10^{-121}:\\
\;\;\;\;1\\

\mathbf{elif}\;x \leq 9 \cdot 10^{-20}:\\
\;\;\;\;\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.0499999999999999e-121 or 9.0000000000000003e-20 < x

    1. Initial program 90.4%

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

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

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

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

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

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

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

    if -1.0499999999999999e-121 < x < 9.0000000000000003e-20

    1. Initial program 95.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-121}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-20}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 8: 64.7% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.08000000000000003e-150 or 7.29999999999999959e-202 < x

    1. Initial program 92.0%

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

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

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

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

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

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

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

    if -1.08000000000000003e-150 < x < 7.29999999999999959e-202

    1. Initial program 93.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.08 \cdot 10^{-150}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 7.3 \cdot 10^{-202}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 9: 52.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 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. Taylor expanded in y around 0 69.7%

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

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

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

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

    \[\leadsto 1 \]

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

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

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