Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B

Percentage Accurate: 75.2% → 88.2%
Time: 13.5s
Alternatives: 12
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 75.2% accurate, 1.0× speedup?

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

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

Alternative 1: 88.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\
t_3 := a + t\_1\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{x}{z \cdot t\_3} + \frac{y}{t \cdot t\_3}\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0

    1. Initial program 39.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*53.4%

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

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 53.4%

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in z around inf 92.6%

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

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

    1. Initial program 91.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing

    if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 11.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative11.6%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified20.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 91.1%

      \[\leadsto \color{blue}{\frac{z}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.5%

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

Alternative 2: 87.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0

    1. Initial program 39.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*53.4%

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

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 53.4%

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in x around 0 72.0%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(a + \frac{b \cdot y}{t}\right)}} \]
    7. Taylor expanded in t around 0 72.1%

      \[\leadsto \frac{y \cdot z}{\color{blue}{a \cdot t + b \cdot y}} \]

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

    1. Initial program 91.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing

    if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 11.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative11.6%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified20.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 91.1%

      \[\leadsto \color{blue}{\frac{z}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.4%

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

Alternative 3: 66.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -7.8 \cdot 10^{-205}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + z \cdot \frac{1}{\frac{t}{y}}}{a + 1}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.6e12 or 4.1999999999999998e86 < y

    1. Initial program 48.9%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*50.7%

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

        \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \color{blue}{y \cdot \frac{b}{t}}} \]
    3. Simplified59.1%

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 48.2%

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in z around inf 48.1%

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{z \cdot \left(a + \frac{b \cdot y}{t}\right)} + \frac{y}{t \cdot \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
    7. Taylor expanded in b around inf 70.5%

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

        \[\leadsto z \cdot \frac{1 + \color{blue}{\frac{\frac{t \cdot x}{y}}{z}}}{b} \]
    9. Simplified71.4%

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

    if -5.6e12 < y < -7.80000000000000036e-205

    1. Initial program 95.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative95.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 73.8%

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

    if -7.80000000000000036e-205 < y < 4.1999999999999998e86

    1. Initial program 94.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative94.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 80.5%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{1 + a}} \]
    6. Step-by-step derivation
      1. *-commutative94.0%

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

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

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

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

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

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

        \[\leadsto \frac{x + z \cdot \color{blue}{\frac{1}{\frac{t}{y}}}}{1 + a} \]
    11. Simplified80.6%

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

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

Alternative 4: 66.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -1.28 \cdot 10^{-204}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1e12 or 4.49999999999999993e86 < y

    1. Initial program 48.9%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*50.7%

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

        \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \color{blue}{y \cdot \frac{b}{t}}} \]
    3. Simplified59.1%

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 48.2%

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in z around inf 48.1%

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{z \cdot \left(a + \frac{b \cdot y}{t}\right)} + \frac{y}{t \cdot \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
    7. Taylor expanded in b around inf 70.5%

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

        \[\leadsto z \cdot \frac{1 + \color{blue}{\frac{\frac{t \cdot x}{y}}{z}}}{b} \]
    9. Simplified71.4%

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

    if -1e12 < y < -1.28000000000000004e-204

    1. Initial program 95.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative95.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 73.8%

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

    if -1.28000000000000004e-204 < y < 4.49999999999999993e86

    1. Initial program 94.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative94.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 80.5%

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

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

Alternative 5: 79.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+58} \lor \neg \left(y \leq 2.2 \cdot 10^{+88}\right):\\
\;\;\;\;z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.9000000000000001e58 or 2.20000000000000009e88 < y

    1. Initial program 42.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*44.1%

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

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 42.1%

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in z around inf 40.2%

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{z \cdot \left(a + \frac{b \cdot y}{t}\right)} + \frac{y}{t \cdot \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
    7. Taylor expanded in b around inf 72.3%

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

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

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

    if -3.9000000000000001e58 < y < 2.20000000000000009e88

    1. Initial program 93.9%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative93.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+58} \lor \neg \left(y \leq 2.2 \cdot 10^{+88}\right):\\ \;\;\;\;z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-26} \lor \neg \left(t \leq 2.4 \cdot 10^{-174}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{y \cdot \frac{b}{t} + \left(a + 1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25000000000000005e-26 or 2.4e-174 < t

    1. Initial program 83.4%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*83.4%

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

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing

    if -1.25000000000000005e-26 < t < 2.4e-174

    1. Initial program 57.4%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*51.2%

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

        \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \color{blue}{y \cdot \frac{b}{t}}} \]
    3. Simplified46.1%

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 43.0%

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in z around inf 63.9%

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{z \cdot \left(a + \frac{b \cdot y}{t}\right)} + \frac{y}{t \cdot \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
    7. Taylor expanded in b around inf 70.1%

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

        \[\leadsto z \cdot \frac{1 + \color{blue}{\frac{\frac{t \cdot x}{y}}{z}}}{b} \]
    9. Simplified73.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{-26} \lor \neg \left(t \leq 2.4 \cdot 10^{-174}\right):\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{y \cdot \frac{b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{1 + \frac{\frac{x \cdot t}{y}}{z}}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 64.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+49}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq -1.22 \cdot 10^{-204}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\

\mathbf{elif}\;y \leq 2.15 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.08000000000000001e49 or 2.1500000000000001e86 < y

    1. Initial program 44.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative44.2%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define46.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 67.1%

      \[\leadsto \color{blue}{\frac{z}{b}} \]

    if -1.08000000000000001e49 < y < -1.22000000000000005e-204

    1. Initial program 93.5%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative93.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 69.6%

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

    if -1.22000000000000005e-204 < y < 2.1500000000000001e86

    1. Initial program 94.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative94.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 80.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{+49}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -1.22 \cdot 10^{-204}:\\ \;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+86}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 64.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq -4.6 \cdot 10^{-205}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+86}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.5000000000000005e49 or 3.2e86 < y

    1. Initial program 44.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative44.2%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define46.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 67.1%

      \[\leadsto \color{blue}{\frac{z}{b}} \]

    if -6.5000000000000005e49 < y < -4.5999999999999998e-205

    1. Initial program 93.5%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative93.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 69.6%

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

    if -4.5999999999999998e-205 < y < 3.2e86

    1. Initial program 94.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative94.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 80.5%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z}{t}}{1 + a}} \]
    6. Step-by-step derivation
      1. *-commutative94.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+49}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-205}:\\ \;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+86}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+49} \lor \neg \left(y \leq 2.15 \cdot 10^{+86}\right):\\
\;\;\;\;\frac{z}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999993e49 or 2.1500000000000001e86 < y

    1. Initial program 44.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative44.2%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define46.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 67.1%

      \[\leadsto \color{blue}{\frac{z}{b}} \]

    if -7.19999999999999993e49 < y < 2.1500000000000001e86

    1. Initial program 93.8%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative93.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 67.3%

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

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

Alternative 10: 56.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -380000000 \lor \neg \left(y \leq 3 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{z}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8e8 or 3.00000000000000018e34 < y

    1. Initial program 51.9%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative51.9%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified61.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 61.7%

      \[\leadsto \color{blue}{\frac{z}{b}} \]

    if -3.8e8 < y < 3.00000000000000018e34

    1. Initial program 96.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative96.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 61.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -380000000 \lor \neg \left(y \leq 3 \cdot 10^{+34}\right):\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 42.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-116} \lor \neg \left(y \leq 4.2 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{z}{b}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.0999999999999999e-116 or 4.2000000000000001e33 < y

    1. Initial program 60.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative60.1%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified65.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 56.4%

      \[\leadsto \color{blue}{\frac{z}{b}} \]

    if -2.0999999999999999e-116 < y < 4.2000000000000001e33

    1. Initial program 96.9%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*91.9%

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

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

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

      \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
    6. Taylor expanded in y around 0 34.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-116} \lor \neg \left(y \leq 4.2 \cdot 10^{+33}\right):\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 25.7% accurate, 5.7× speedup?

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

\\
\frac{x}{a}
\end{array}
Derivation
  1. Initial program 74.0%

    \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
  2. Step-by-step derivation
    1. associate-/l*71.9%

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

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

    \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
  4. Add Preprocessing
  5. Taylor expanded in a around inf 50.4%

    \[\leadsto \frac{x + y \cdot \frac{z}{t}}{\color{blue}{a} + y \cdot \frac{b}{t}} \]
  6. Taylor expanded in y around 0 20.3%

    \[\leadsto \color{blue}{\frac{x}{a}} \]
  7. Add Preprocessing

Developer Target 1: 78.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024160 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))

  (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))