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

Percentage Accurate: 75.1% → 92.2%
Time: 21.7s
Alternatives: 18
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 18 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.1% 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: 92.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{y}{\frac{t \cdot \mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}{z}}\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 10^{+297}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (/ z b) (* t (/ (/ x b) y))))
        (t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
   (if (<= t_2 (- INFINITY))
     (/ y (/ (* t (fma y (/ b t) (+ a 1.0))) z))
     (if (<= t_2 -2e-314)
       t_2
       (if (<= t_2 0.0)
         t_1
         (if (<= t_2 1e+297)
           t_2
           (if (<= t_2 INFINITY)
             (* (/ y t) (/ z (+ 1.0 (fma y (/ b t) a))))
             t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z / b) + (t * ((x / b) / y));
	double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = y / ((t * fma(y, (b / t), (a + 1.0))) / z);
	} else if (t_2 <= -2e-314) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 1e+297) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (y / t) * (z / (1.0 + fma(y, (b / t), a)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y)))
	t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(y / Float64(Float64(t * fma(y, Float64(b / t), Float64(a + 1.0))) / z));
	elseif (t_2 <= -2e-314)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 1e+297)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + fma(y, Float64(b / t), a))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, (-Infinity)], N[(y / N[(N[(t * N[(y * N[(b / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-314], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+297], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq 10^{+297}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 38.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}{z}}} \]
      2. associate-+r+90.1%

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

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

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

        \[\leadsto \frac{y}{\frac{t \cdot \color{blue}{\left(\frac{b}{\frac{t}{y}} + \left(a + 1\right)\right)}}{z}} \]
      6. associate-/r/90.1%

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999e-314 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e297

    1. Initial program 99.5%

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

    if -1.9999999999e-314 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 31.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{b \cdot y}{x + \frac{y \cdot z}{t}}}} \]
      2. *-commutative30.4%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/30.6%

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef30.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t} + x}}} \]
      2. *-commutative30.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr30.6%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified83.4%

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

    if 1e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 5.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{t} \cdot \frac{z}{1 + \left(\color{blue}{\frac{b}{t} \cdot y} + a\right)} \]
      5. *-commutative88.8%

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

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

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

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

Alternative 2: 92.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ t_3 := \frac{y}{t} \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 10^{+297}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (/ z b) (* t (/ (/ x b) y))))
        (t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
        (t_3 (* (/ y t) (/ z (+ 1.0 (fma y (/ b t) a))))))
   (if (<= t_2 (- INFINITY))
     t_3
     (if (<= t_2 -2e-314)
       t_2
       (if (<= t_2 0.0)
         t_1
         (if (<= t_2 1e+297) t_2 (if (<= t_2 INFINITY) t_3 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z / b) + (t * ((x / b) / y));
	double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
	double t_3 = (y / t) * (z / (1.0 + fma(y, (b / t), a)));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_2 <= -2e-314) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 1e+297) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y)))
	t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
	t_3 = Float64(Float64(y / t) * Float64(z / Float64(1.0 + fma(y, Float64(b / t), a))))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_2 <= -2e-314)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 1e+297)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-314], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 1e+297], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq 10^{+297}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 28.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{t} \cdot \frac{z}{1 + \color{blue}{\left(\frac{b}{\frac{t}{y}} + a\right)}} \]
      4. associate-/r/80.0%

        \[\leadsto \frac{y}{t} \cdot \frac{z}{1 + \left(\color{blue}{\frac{b}{t} \cdot y} + a\right)} \]
      5. *-commutative80.0%

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999e-314 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e297

    1. Initial program 99.5%

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

    if -1.9999999999e-314 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 31.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{b \cdot y}{x + \frac{y \cdot z}{t}}}} \]
      2. *-commutative30.4%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/30.6%

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef30.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t} + x}}} \]
      2. *-commutative30.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr30.6%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified83.4%

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

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

Alternative 3: 89.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot b}{t}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t_1}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{y \cdot z}{t \cdot \left(1 + \left(a + t_1\right)\right)}\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314} \lor \neg \left(t_2 \leq 0\right) \land t_2 \leq 10^{+297}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\ \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)) (+ (+ a 1.0) t_1))))
   (if (<= t_2 (- INFINITY))
     (/ (* y z) (* t (+ 1.0 (+ a t_1))))
     (if (or (<= t_2 -2e-314) (and (not (<= t_2 0.0)) (<= t_2 1e+297)))
       t_2
       (+ (/ z b) (* t (/ (/ x b) y)))))))
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)) / ((a + 1.0) + t_1);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = (y * z) / (t * (1.0 + (a + t_1)));
	} else if ((t_2 <= -2e-314) || (!(t_2 <= 0.0) && (t_2 <= 1e+297))) {
		tmp = t_2;
	} else {
		tmp = (z / b) + (t * ((x / b) / y));
	}
	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)) / ((a + 1.0) + t_1);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = (y * z) / (t * (1.0 + (a + t_1)));
	} else if ((t_2 <= -2e-314) || (!(t_2 <= 0.0) && (t_2 <= 1e+297))) {
		tmp = t_2;
	} else {
		tmp = (z / b) + (t * ((x / b) / y));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (y * b) / t
	t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = (y * z) / (t * (1.0 + (a + t_1)))
	elif (t_2 <= -2e-314) or (not (t_2 <= 0.0) and (t_2 <= 1e+297)):
		tmp = t_2
	else:
		tmp = (z / b) + (t * ((x / b) / y))
	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(Float64(a + 1.0) + t_1))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(Float64(y * z) / Float64(t * Float64(1.0 + Float64(a + t_1))));
	elseif ((t_2 <= -2e-314) || (!(t_2 <= 0.0) && (t_2 <= 1e+297)))
		tmp = t_2;
	else
		tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y)));
	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)) / ((a + 1.0) + t_1);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = (y * z) / (t * (1.0 + (a + t_1)));
	elseif ((t_2 <= -2e-314) || (~((t_2 <= 0.0)) && (t_2 <= 1e+297)))
		tmp = t_2;
	else
		tmp = (z / b) + (t * ((x / b) / y));
	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[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y * z), $MachinePrecision] / N[(t * N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, -2e-314], And[N[Not[LessEqual[t$95$2, 0.0]], $MachinePrecision], LessEqual[t$95$2, 1e+297]]], t$95$2, N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-314} \lor \neg \left(t_2 \leq 0\right) \land t_2 \leq 10^{+297}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 38.5%

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999e-314 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1e297

    1. Initial program 99.5%

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

    if -1.9999999999e-314 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or 1e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 28.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/27.5%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t}} + x}} \]
      5. fma-udef27.5%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    7. Simplified27.5%

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef27.5%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr27.5%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified78.7%

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

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

Alternative 4: 54.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;y \leq -8.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+61}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+78} \lor \neg \left(y \leq 10^{+145}\right):\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ x (+ a 1.0))))
   (if (<= y -8.4e-29)
     (/ z b)
     (if (<= y 2.6e-63)
       t_1
       (if (<= y 2.15e+15)
         (/ x (+ 1.0 (/ (* y b) t)))
         (if (<= y 2.3e+61)
           (/ (+ x (* z (/ y t))) a)
           (if (or (<= y 5.2e+78) (not (<= y 1e+145))) (/ z b) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x / (a + 1.0);
	double tmp;
	if (y <= -8.4e-29) {
		tmp = z / b;
	} else if (y <= 2.6e-63) {
		tmp = t_1;
	} else if (y <= 2.15e+15) {
		tmp = x / (1.0 + ((y * b) / t));
	} else if (y <= 2.3e+61) {
		tmp = (x + (z * (y / t))) / a;
	} else if ((y <= 5.2e+78) || !(y <= 1e+145)) {
		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 = x / (a + 1.0d0)
    if (y <= (-8.4d-29)) then
        tmp = z / b
    else if (y <= 2.6d-63) then
        tmp = t_1
    else if (y <= 2.15d+15) then
        tmp = x / (1.0d0 + ((y * b) / t))
    else if (y <= 2.3d+61) then
        tmp = (x + (z * (y / t))) / a
    else if ((y <= 5.2d+78) .or. (.not. (y <= 1d+145))) 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 = x / (a + 1.0);
	double tmp;
	if (y <= -8.4e-29) {
		tmp = z / b;
	} else if (y <= 2.6e-63) {
		tmp = t_1;
	} else if (y <= 2.15e+15) {
		tmp = x / (1.0 + ((y * b) / t));
	} else if (y <= 2.3e+61) {
		tmp = (x + (z * (y / t))) / a;
	} else if ((y <= 5.2e+78) || !(y <= 1e+145)) {
		tmp = z / b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x / (a + 1.0)
	tmp = 0
	if y <= -8.4e-29:
		tmp = z / b
	elif y <= 2.6e-63:
		tmp = t_1
	elif y <= 2.15e+15:
		tmp = x / (1.0 + ((y * b) / t))
	elif y <= 2.3e+61:
		tmp = (x + (z * (y / t))) / a
	elif (y <= 5.2e+78) or not (y <= 1e+145):
		tmp = z / b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x / Float64(a + 1.0))
	tmp = 0.0
	if (y <= -8.4e-29)
		tmp = Float64(z / b);
	elseif (y <= 2.6e-63)
		tmp = t_1;
	elseif (y <= 2.15e+15)
		tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t)));
	elseif (y <= 2.3e+61)
		tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / a);
	elseif ((y <= 5.2e+78) || !(y <= 1e+145))
		tmp = Float64(z / b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x / (a + 1.0);
	tmp = 0.0;
	if (y <= -8.4e-29)
		tmp = z / b;
	elseif (y <= 2.6e-63)
		tmp = t_1;
	elseif (y <= 2.15e+15)
		tmp = x / (1.0 + ((y * b) / t));
	elseif (y <= 2.3e+61)
		tmp = (x + (z * (y / t))) / a;
	elseif ((y <= 5.2e+78) || ~((y <= 1e+145)))
		tmp = z / b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.4e-29], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.6e-63], t$95$1, If[LessEqual[y, 2.15e+15], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+61], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[y, 5.2e+78], N[Not[LessEqual[y, 1e+145]], $MachinePrecision]], N[(z / b), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;y \leq -8.4 \cdot 10^{-29}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.15 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{+61}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+78} \lor \neg \left(y \leq 10^{+145}\right):\\
\;\;\;\;\frac{z}{b}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8.39999999999999958e-29 or 2.3e61 < y < 5.2e78 or 9.9999999999999999e144 < y

    1. Initial program 52.4%

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

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

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

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

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

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

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

    if -8.39999999999999958e-29 < y < 2.6000000000000001e-63 or 5.2e78 < y < 9.9999999999999999e144

    1. Initial program 93.1%

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

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

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

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

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

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

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

    if 2.6000000000000001e-63 < y < 2.15e15

    1. Initial program 93.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u32.7%

        \[\leadsto \frac{x}{1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)\right)}} \]
      2. expm1-udef32.7%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(e^{\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)} - 1\right)}} \]
      3. log1p-udef32.7%

        \[\leadsto \frac{x}{1 + \left(e^{\color{blue}{\log \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} - 1\right)} \]
      4. add-exp-log67.5%

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

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(\left(1 + \left(a + \frac{b}{\frac{t}{y}}\right)\right) - 1\right)}} \]
    8. Step-by-step derivation
      1. associate--l+67.1%

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(1 + \left(\left(a + \frac{b}{\frac{t}{y}}\right) - 1\right)\right)}} \]
    10. Taylor expanded in a around 0 60.1%

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

    if 2.15e15 < y < 2.3e61

    1. Initial program 81.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r/81.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+61}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+78} \lor \neg \left(y \leq 10^{+145}\right):\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-21}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-257}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.5499999999999999e-21

    1. Initial program 56.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{b \cdot y}{x + \frac{y \cdot z}{t}}}} \]
      2. *-commutative34.4%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/34.6%

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef34.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t} + x}}} \]
      2. *-commutative34.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr34.6%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified70.2%

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

    if -1.5499999999999999e-21 < y < -7.4999999999999995e-257

    1. Initial program 91.9%

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

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

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

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

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

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

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

    if -7.4999999999999995e-257 < y < 8.9999999999999996e145

    1. Initial program 93.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    6. Step-by-step derivation
      1. clear-num78.3%

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

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

        \[\leadsto {\left(\frac{1 + \left(a + \color{blue}{\frac{b}{\frac{t}{y}}}\right)}{x}\right)}^{-1} \]
    7. Applied egg-rr79.4%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}{x}}} \]
    9. Simplified79.4%

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

    if 8.9999999999999996e145 < y

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

Alternative 6: 79.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.9000000000000003e-192 or 1.70000000000000007e-183 < t

    1. Initial program 81.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r/84.1%

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

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

    if -3.9000000000000003e-192 < t < 1.70000000000000007e-183

    1. Initial program 45.3%

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

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

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

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

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

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

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

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

Alternative 7: 79.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-183}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\

\mathbf{elif}\;t \leq 1.8 \cdot 10^{-183}:\\
\;\;\;\;\frac{z}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.45e-183

    1. Initial program 82.3%

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

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

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

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

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

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

    if -1.45e-183 < t < 1.8000000000000001e-183

    1. Initial program 45.3%

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

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

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

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

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

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

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

    if 1.8000000000000001e-183 < t

    1. Initial program 80.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*79.9%

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

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r/85.0%

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

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

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

Alternative 8: 79.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \left(1 + \frac{y}{\frac{t}{b}}\right)\\ \mathbf{if}\;t \leq -1.55 \cdot 10^{-192}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{t_1}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-184}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ a (+ 1.0 (/ y (/ t b))))))
   (if (<= t -1.55e-192)
     (/ (+ x (/ y (/ t z))) t_1)
     (if (<= t 2.5e-184) (/ z b) (/ (+ x (* z (/ y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a + (1.0 + (y / (t / b)));
	double tmp;
	if (t <= -1.55e-192) {
		tmp = (x + (y / (t / z))) / t_1;
	} else if (t <= 2.5e-184) {
		tmp = z / b;
	} else {
		tmp = (x + (z * (y / t))) / 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 = a + (1.0d0 + (y / (t / b)))
    if (t <= (-1.55d-192)) then
        tmp = (x + (y / (t / z))) / t_1
    else if (t <= 2.5d-184) then
        tmp = z / b
    else
        tmp = (x + (z * (y / t))) / 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 = a + (1.0 + (y / (t / b)));
	double tmp;
	if (t <= -1.55e-192) {
		tmp = (x + (y / (t / z))) / t_1;
	} else if (t <= 2.5e-184) {
		tmp = z / b;
	} else {
		tmp = (x + (z * (y / t))) / t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a + (1.0 + (y / (t / b)))
	tmp = 0
	if t <= -1.55e-192:
		tmp = (x + (y / (t / z))) / t_1
	elif t <= 2.5e-184:
		tmp = z / b
	else:
		tmp = (x + (z * (y / t))) / t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))
	tmp = 0.0
	if (t <= -1.55e-192)
		tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / t_1);
	elseif (t <= 2.5e-184)
		tmp = Float64(z / b);
	else
		tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a + (1.0 + (y / (t / b)));
	tmp = 0.0;
	if (t <= -1.55e-192)
		tmp = (x + (y / (t / z))) / t_1;
	elseif (t <= 2.5e-184)
		tmp = z / b;
	else
		tmp = (x + (z * (y / t))) / t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-192], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 2.5e-184], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.5 \cdot 10^{-184}:\\
\;\;\;\;\frac{z}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.55e-192

    1. Initial program 82.3%

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

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

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

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

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

    if -1.55e-192 < t < 2.50000000000000001e-184

    1. Initial program 45.3%

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

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

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

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

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

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

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

    if 2.50000000000000001e-184 < t

    1. Initial program 80.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*79.9%

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

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

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r/85.0%

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

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

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

Alternative 9: 62.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-22}:\\ \;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-253}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -3.3e-22)
   (+ (/ z b) (* t (/ (/ x b) y)))
   (if (<= y -6e-253)
     (/ (+ x (/ (* y z) t)) (+ a 1.0))
     (if (<= y 2e+145) (/ x (+ (+ a 1.0) (* y (/ b t)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.3e-22) {
		tmp = (z / b) + (t * ((x / b) / y));
	} else if (y <= -6e-253) {
		tmp = (x + ((y * z) / t)) / (a + 1.0);
	} else if (y <= 2e+145) {
		tmp = x / ((a + 1.0) + (y * (b / t)));
	} 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 <= (-3.3d-22)) then
        tmp = (z / b) + (t * ((x / b) / y))
    else if (y <= (-6d-253)) then
        tmp = (x + ((y * z) / t)) / (a + 1.0d0)
    else if (y <= 2d+145) then
        tmp = x / ((a + 1.0d0) + (y * (b / t)))
    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 <= -3.3e-22) {
		tmp = (z / b) + (t * ((x / b) / y));
	} else if (y <= -6e-253) {
		tmp = (x + ((y * z) / t)) / (a + 1.0);
	} else if (y <= 2e+145) {
		tmp = x / ((a + 1.0) + (y * (b / t)));
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -3.3e-22:
		tmp = (z / b) + (t * ((x / b) / y))
	elif y <= -6e-253:
		tmp = (x + ((y * z) / t)) / (a + 1.0)
	elif y <= 2e+145:
		tmp = x / ((a + 1.0) + (y * (b / t)))
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -3.3e-22)
		tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y)));
	elseif (y <= -6e-253)
		tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0));
	elseif (y <= 2e+145)
		tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t))));
	else
		tmp = Float64(z / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -3.3e-22)
		tmp = (z / b) + (t * ((x / b) / y));
	elseif (y <= -6e-253)
		tmp = (x + ((y * z) / t)) / (a + 1.0);
	elseif (y <= 2e+145)
		tmp = x / ((a + 1.0) + (y * (b / t)));
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.3e-22], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e-253], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+145], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\

\mathbf{elif}\;y \leq -6 \cdot 10^{-253}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.3000000000000001e-22

    1. Initial program 56.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{b \cdot y}{x + \frac{y \cdot z}{t}}}} \]
      2. *-commutative34.4%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/34.6%

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef34.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t} + x}}} \]
      2. *-commutative34.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr34.6%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified70.2%

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

    if -3.3000000000000001e-22 < y < -6.0000000000000004e-253

    1. Initial program 91.3%

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

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

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

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

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

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

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

    if -6.0000000000000004e-253 < y < 2e145

    1. Initial program 93.6%

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

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

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

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

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

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

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

    if 2e145 < y

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

Alternative 10: 63.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-253}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.6000000000000001e-21

    1. Initial program 56.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{b \cdot y}{x + \frac{y \cdot z}{t}}}} \]
      2. *-commutative34.4%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/34.6%

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef34.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t} + x}}} \]
      2. *-commutative34.6%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr34.6%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified70.2%

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

    if -1.6000000000000001e-21 < y < -6.4999999999999998e-253

    1. Initial program 91.3%

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

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

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

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

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

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

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

    if -6.4999999999999998e-253 < y < 6.9999999999999998e148

    1. Initial program 93.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity79.1%

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

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

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

    if 6.9999999999999998e148 < y

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

Alternative 11: 54.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;y \leq -2.05 \cdot 10^{-22}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 24:\\ \;\;\;\;t \cdot \frac{\frac{x}{b}}{y}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+19}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ x (+ a 1.0))))
   (if (<= y -2.05e-22)
     (/ z b)
     (if (<= y 5.5e-62)
       t_1
       (if (<= y 24.0) (* t (/ (/ x b) y)) (if (<= y 3.5e+19) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x / (a + 1.0);
	double tmp;
	if (y <= -2.05e-22) {
		tmp = z / b;
	} else if (y <= 5.5e-62) {
		tmp = t_1;
	} else if (y <= 24.0) {
		tmp = t * ((x / b) / y);
	} else if (y <= 3.5e+19) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x / (a + 1.0d0)
    if (y <= (-2.05d-22)) then
        tmp = z / b
    else if (y <= 5.5d-62) then
        tmp = t_1
    else if (y <= 24.0d0) then
        tmp = t * ((x / b) / y)
    else if (y <= 3.5d+19) then
        tmp = t_1
    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 t_1 = x / (a + 1.0);
	double tmp;
	if (y <= -2.05e-22) {
		tmp = z / b;
	} else if (y <= 5.5e-62) {
		tmp = t_1;
	} else if (y <= 24.0) {
		tmp = t * ((x / b) / y);
	} else if (y <= 3.5e+19) {
		tmp = t_1;
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x / (a + 1.0)
	tmp = 0
	if y <= -2.05e-22:
		tmp = z / b
	elif y <= 5.5e-62:
		tmp = t_1
	elif y <= 24.0:
		tmp = t * ((x / b) / y)
	elif y <= 3.5e+19:
		tmp = t_1
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x / Float64(a + 1.0))
	tmp = 0.0
	if (y <= -2.05e-22)
		tmp = Float64(z / b);
	elseif (y <= 5.5e-62)
		tmp = t_1;
	elseif (y <= 24.0)
		tmp = Float64(t * Float64(Float64(x / b) / y));
	elseif (y <= 3.5e+19)
		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 / (a + 1.0);
	tmp = 0.0;
	if (y <= -2.05e-22)
		tmp = z / b;
	elseif (y <= 5.5e-62)
		tmp = t_1;
	elseif (y <= 24.0)
		tmp = t * ((x / b) / y);
	elseif (y <= 3.5e+19)
		tmp = t_1;
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.05e-22], N[(z / b), $MachinePrecision], If[LessEqual[y, 5.5e-62], t$95$1, If[LessEqual[y, 24.0], N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+19], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;y \leq -2.05 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 24:\\
\;\;\;\;t \cdot \frac{\frac{x}{b}}{y}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+19}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.05e-22 or 3.5e19 < y

    1. Initial program 53.5%

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

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

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

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

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

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

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

    if -2.05e-22 < y < 5.50000000000000022e-62 or 24 < y < 3.5e19

    1. Initial program 96.3%

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

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

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

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

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

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

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

    if 5.50000000000000022e-62 < y < 24

    1. Initial program 90.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u19.4%

        \[\leadsto \frac{x}{1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)\right)}} \]
      2. expm1-udef19.4%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(e^{\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)} - 1\right)}} \]
      3. log1p-udef19.4%

        \[\leadsto \frac{x}{1 + \left(e^{\color{blue}{\log \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} - 1\right)} \]
      4. add-exp-log60.7%

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

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(\left(1 + \left(a + \frac{b}{\frac{t}{y}}\right)\right) - 1\right)}} \]
    8. Step-by-step derivation
      1. associate--l+60.1%

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(1 + \left(\left(a + \frac{b}{\frac{t}{y}}\right) - 1\right)\right)}} \]
    10. Taylor expanded in b around inf 48.8%

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

        \[\leadsto \color{blue}{t \cdot \frac{x}{b \cdot y}} \]
      2. associate-/r*50.0%

        \[\leadsto t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified50.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-22}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 24:\\ \;\;\;\;t \cdot \frac{\frac{x}{b}}{y}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 53.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-28}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{a + 1}\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{+135}:\\
\;\;\;\;\frac{x}{1 + \frac{b}{\frac{t}{y}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.94999999999999999e-28 or 2.3000000000000001e135 < y

    1. Initial program 51.2%

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

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

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

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

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

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

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

    if -1.94999999999999999e-28 < y < 1.3000000000000001e-63

    1. Initial program 96.1%

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

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

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

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

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

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

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

    if 1.3000000000000001e-63 < y < 2.3000000000000001e135

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{1 + \color{blue}{\frac{b}{\frac{t}{y}}}} \]
    8. Simplified45.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{-28}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+135}:\\ \;\;\;\;\frac{x}{1 + \frac{b}{\frac{t}{y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 58.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-27} \lor \neg \left(y \leq 4.6 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4e-27 or 4.60000000000000001e-62 < y

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/35.1%

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef35.1%

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr35.1%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified64.8%

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

    if -1.4e-27 < y < 4.60000000000000001e-62

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

Alternative 14: 61.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.60000000000000038e-7

    1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{y \cdot z}{t} + x}}} \]
      4. associate-*r/32.8%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t}} + x}} \]
      5. fma-udef32.8%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    7. Simplified32.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot b}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}}} \]
    8. Step-by-step derivation
      1. fma-udef32.8%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{y \cdot \frac{z}{t} + x}}} \]
      2. *-commutative32.8%

        \[\leadsto \frac{t}{\frac{y \cdot b}{\color{blue}{\frac{z}{t} \cdot y} + x}} \]
    9. Applied egg-rr32.8%

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

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

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

        \[\leadsto \frac{z}{b} + t \cdot \color{blue}{\frac{\frac{x}{b}}{y}} \]
    12. Simplified70.9%

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

    if -5.60000000000000038e-7 < y < 6.9999999999999998e148

    1. Initial program 93.1%

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

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

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

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

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

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

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

    if 6.9999999999999998e148 < y

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

Alternative 15: 41.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-73}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -1.06 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -3e-73)
   (/ z b)
   (if (<= y -1.06e-294) (/ x a) (if (<= y 5e-62) x (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3e-73) {
		tmp = z / b;
	} else if (y <= -1.06e-294) {
		tmp = x / a;
	} else if (y <= 5e-62) {
		tmp = x;
	} 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 <= (-3d-73)) then
        tmp = z / b
    else if (y <= (-1.06d-294)) then
        tmp = x / a
    else if (y <= 5d-62) then
        tmp = x
    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 <= -3e-73) {
		tmp = z / b;
	} else if (y <= -1.06e-294) {
		tmp = x / a;
	} else if (y <= 5e-62) {
		tmp = x;
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -3e-73:
		tmp = z / b
	elif y <= -1.06e-294:
		tmp = x / a
	elif y <= 5e-62:
		tmp = x
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -3e-73)
		tmp = Float64(z / b);
	elseif (y <= -1.06e-294)
		tmp = Float64(x / a);
	elseif (y <= 5e-62)
		tmp = x;
	else
		tmp = Float64(z / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -3e-73)
		tmp = z / b;
	elseif (y <= -1.06e-294)
		tmp = x / a;
	elseif (y <= 5e-62)
		tmp = x;
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3e-73], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.06e-294], N[(x / a), $MachinePrecision], If[LessEqual[y, 5e-62], x, N[(z / b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-73}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{elif}\;y \leq -1.06 \cdot 10^{-294}:\\
\;\;\;\;\frac{x}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3e-73 or 5.0000000000000002e-62 < y

    1. Initial program 59.3%

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

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

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

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

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

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

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

    if -3e-73 < y < -1.0600000000000001e-294

    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{x + \frac{\color{blue}{z \cdot y}}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      2. associate-*l/89.4%

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

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

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

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

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

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

    if -1.0600000000000001e-294 < y < 5.0000000000000002e-62

    1. Initial program 99.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u66.3%

        \[\leadsto \frac{x}{1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)\right)}} \]
      2. expm1-udef66.3%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(e^{\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)} - 1\right)}} \]
      3. log1p-udef66.3%

        \[\leadsto \frac{x}{1 + \left(e^{\color{blue}{\log \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} - 1\right)} \]
      4. add-exp-log90.4%

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

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(\left(1 + \left(a + \frac{b}{\frac{t}{y}}\right)\right) - 1\right)}} \]
    8. Step-by-step derivation
      1. associate--l+90.4%

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(1 + \left(\left(a + \frac{b}{\frac{t}{y}}\right) - 1\right)\right)}} \]
    10. Taylor expanded in b around 0 78.9%

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

        \[\leadsto \frac{x}{\color{blue}{a + 1}} \]
    12. Simplified78.9%

      \[\leadsto \color{blue}{\frac{x}{a + 1}} \]
    13. Taylor expanded in a around 0 48.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-73}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -1.06 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 54.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.26 \cdot 10^{-23} \lor \neg \left(y \leq 5.5 \cdot 10^{-62}\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 -1.26e-23) (not (<= y 5.5e-62))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.26e-23) || !(y <= 5.5e-62)) {
		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 <= (-1.26d-23)) .or. (.not. (y <= 5.5d-62))) 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 <= -1.26e-23) || !(y <= 5.5e-62)) {
		tmp = z / b;
	} else {
		tmp = x / (a + 1.0);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -1.26e-23) or not (y <= 5.5e-62):
		tmp = z / b
	else:
		tmp = x / (a + 1.0)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -1.26e-23) || !(y <= 5.5e-62))
		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 <= -1.26e-23) || ~((y <= 5.5e-62)))
		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, -1.26e-23], N[Not[LessEqual[y, 5.5e-62]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{-23} \lor \neg \left(y \leq 5.5 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{z}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.25999999999999996e-23 or 5.50000000000000022e-62 < y

    1. Initial program 57.8%

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

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

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

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

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

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

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

    if -1.25999999999999996e-23 < y < 5.50000000000000022e-62

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

Alternative 17: 41.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 7.5 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1 or 7.50000000000000019e-6 < a

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

    if -1 < a < 7.50000000000000019e-6

    1. Initial program 73.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u43.7%

        \[\leadsto \frac{x}{1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)\right)}} \]
      2. expm1-udef43.7%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(e^{\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)} - 1\right)}} \]
      3. log1p-udef43.7%

        \[\leadsto \frac{x}{1 + \left(e^{\color{blue}{\log \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} - 1\right)} \]
      4. add-exp-log53.2%

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

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(\left(1 + \left(a + \frac{b}{\frac{t}{y}}\right)\right) - 1\right)}} \]
    8. Step-by-step derivation
      1. associate--l+53.9%

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

      \[\leadsto \frac{x}{1 + \color{blue}{\left(1 + \left(\left(a + \frac{b}{\frac{t}{y}}\right) - 1\right)\right)}} \]
    10. Taylor expanded in b around 0 37.3%

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

        \[\leadsto \frac{x}{\color{blue}{a + 1}} \]
    12. Simplified37.3%

      \[\leadsto \color{blue}{\frac{x}{a + 1}} \]
    13. Taylor expanded in a around 0 36.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 7.5 \cdot 10^{-6}\right):\\ \;\;\;\;\frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 20.1% accurate, 17.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\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. *-commutative74.0%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
  6. Step-by-step derivation
    1. expm1-log1p-u34.7%

      \[\leadsto \frac{x}{1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    2. expm1-udef34.7%

      \[\leadsto \frac{x}{1 + \color{blue}{\left(e^{\mathsf{log1p}\left(a + \frac{b \cdot y}{t}\right)} - 1\right)}} \]
    3. log1p-udef34.7%

      \[\leadsto \frac{x}{1 + \left(e^{\color{blue}{\log \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} - 1\right)} \]
    4. add-exp-log53.8%

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

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

    \[\leadsto \frac{x}{1 + \color{blue}{\left(\left(1 + \left(a + \frac{b}{\frac{t}{y}}\right)\right) - 1\right)}} \]
  8. Step-by-step derivation
    1. associate--l+54.9%

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

    \[\leadsto \frac{x}{1 + \color{blue}{\left(1 + \left(\left(a + \frac{b}{\frac{t}{y}}\right) - 1\right)\right)}} \]
  10. Taylor expanded in b around 0 41.5%

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

      \[\leadsto \frac{x}{\color{blue}{a + 1}} \]
  12. Simplified41.5%

    \[\leadsto \color{blue}{\frac{x}{a + 1}} \]
  13. Taylor expanded in a around 0 21.2%

    \[\leadsto \color{blue}{x} \]
  14. Final simplification21.2%

    \[\leadsto x \]
  15. Add Preprocessing

Developer target: 79.2% 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 2024020 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64

  :herbie-target
  (if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))

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