Average Error: 16.5 → 6.5
Time: 19.2s
Precision: binary64
Cost: 6868
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{z - \frac{t}{\frac{-y}{x}}}{b}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq -4 \cdot 10^{-319}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{elif}\;t_1 \leq 10^{+304}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
   (if (<= t_1 (- INFINITY))
     (/ (- z (/ t (/ (- y) x))) b)
     (if (<= t_1 -5e-57)
       t_1
       (if (<= t_1 -4e-319)
         (/ (+ x (* z (/ y t))) (+ 1.0 (+ a (* b (/ y t)))))
         (if (<= t_1 0.0)
           (+ (/ z b) (* (/ t y) (/ x b)))
           (if (<= t_1 1e+304) t_1 (/ z b))))))))
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));
}
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (z - (t / (-y / x))) / b;
	} else if (t_1 <= -5e-57) {
		tmp = t_1;
	} else if (t_1 <= -4e-319) {
		tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))));
	} else if (t_1 <= 0.0) {
		tmp = (z / b) + ((t / y) * (x / b));
	} else if (t_1 <= 1e+304) {
		tmp = t_1;
	} else {
		tmp = z / b;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (z - (t / (-y / x))) / b;
	} else if (t_1 <= -5e-57) {
		tmp = t_1;
	} else if (t_1 <= -4e-319) {
		tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))));
	} else if (t_1 <= 0.0) {
		tmp = (z / b) + ((t / y) * (x / b));
	} else if (t_1 <= 1e+304) {
		tmp = t_1;
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
def code(x, y, z, t, a, b):
	t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (z - (t / (-y / x))) / b
	elif t_1 <= -5e-57:
		tmp = t_1
	elif t_1 <= -4e-319:
		tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))))
	elif t_1 <= 0.0:
		tmp = (z / b) + ((t / y) * (x / b))
	elif t_1 <= 1e+304:
		tmp = t_1
	else:
		tmp = z / b
	return tmp
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 code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(z - Float64(t / Float64(Float64(-y) / x))) / b);
	elseif (t_1 <= -5e-57)
		tmp = t_1;
	elseif (t_1 <= -4e-319)
		tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))));
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b)));
	elseif (t_1 <= 1e+304)
		tmp = t_1;
	else
		tmp = Float64(z / b);
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (z - (t / (-y / x))) / b;
	elseif (t_1 <= -5e-57)
		tmp = t_1;
	elseif (t_1 <= -4e-319)
		tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))));
	elseif (t_1 <= 0.0)
		tmp = (z / b) + ((t / y) * (x / b));
	elseif (t_1 <= 1e+304)
		tmp = t_1;
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
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]
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z - N[(t / N[((-y) / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, -5e-57], t$95$1, If[LessEqual[t$95$1, -4e-319], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+304], t$95$1, N[(z / b), $MachinePrecision]]]]]]]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{z - \frac{t}{\frac{-y}{x}}}{b}\\

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-57}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\

\mathbf{elif}\;t_1 \leq 10^{+304}:\\
\;\;\;\;t_1\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.5
Target12.9
Herbie6.5
\[\begin{array}{l} \mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\ \;\;\;\;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{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\ \end{array} \]

Derivation

  1. Split input into 5 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 64.0

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}} \]
      Proof
      (/.f64 (+.f64 x (/.f64 y (/.f64 t z))) (+.f64 (+.f64 a 1) (/.f64 y (/.f64 t b)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) t))) (+.f64 (+.f64 a 1) (/.f64 y (/.f64 t b)))): 21 points increase in error, 21 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)))): 9 points increase in error, 14 points decrease in error
    3. Taylor expanded in b around inf 64.0

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

      \[\leadsto \color{blue}{\frac{t}{b} \cdot \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{y}} \]
      Proof
      (*.f64 (/.f64 t b) (/.f64 (fma.f64 y (/.f64 z t) x) y)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 t b) (/.f64 (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 y (/.f64 z t)) x)) y)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 t b) (/.f64 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y z) t)) x) y)): 20 points increase in error, 3 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (*.f64 b y))): 35 points increase in error, 40 points decrease in error
      (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (Rewrite<= *-commutative_binary64 (*.f64 y b))): 0 points increase in error, 0 points decrease in error
    5. Taylor expanded in t around 0 35.0

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

      \[\leadsto \color{blue}{\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}} \]
      Proof
      (+.f64 (/.f64 z b) (*.f64 (/.f64 t y) (/.f64 x b))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 t x) (*.f64 y b)))): 33 points increase in error, 27 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 t x) (*.f64 y b)) (/.f64 z b))): 0 points increase in error, 0 points decrease in error
    7. Taylor expanded in b around 0 35.0

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

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

      \[\leadsto \frac{\color{blue}{z - \frac{t}{\frac{-y}{x}}}}{b} \]
      Proof
      (-.f64 z (/.f64 t (/.f64 (neg.f64 y) x))): 0 points increase in error, 0 points decrease in error
      (-.f64 z (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 t x) (neg.f64 y)))): 23 points increase in error, 22 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 z (neg.f64 (/.f64 (*.f64 t x) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 z (Rewrite=> distribute-neg-frac_binary64 (/.f64 (neg.f64 (*.f64 t x)) (neg.f64 y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 z (/.f64 (Rewrite<= distribute-rgt-neg-out_binary64 (*.f64 t (neg.f64 x))) (neg.f64 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 z (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (*.f64 t (neg.f64 x)) 1)) (neg.f64 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 z (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 t (neg.f64 x)) (/.f64 1 (neg.f64 y))))): 8 points increase in error, 10 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (*.f64 t (neg.f64 x)) (/.f64 1 (neg.f64 y))) z)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-udef_binary64 (fma.f64 (*.f64 t (neg.f64 x)) (/.f64 1 (neg.f64 y)) z)): 0 points increase in error, 0 points decrease in error

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.0000000000000002e-57 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999994e303

    1. Initial program 0.3

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

    if -5.0000000000000002e-57 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -4.0000049e-319

    1. Initial program 1.0

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{t} \cdot z}{1 + \left(a + \frac{y}{t} \cdot b\right)}} \]
      Proof
      (/.f64 (+.f64 x (*.f64 (/.f64 y t) z)) (+.f64 1 (+.f64 a (*.f64 (/.f64 y t) b)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y z) t))) (+.f64 1 (+.f64 a (*.f64 (/.f64 y t) b)))): 25 points increase in error, 20 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 1 (+.f64 a (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y b) t))))): 9 points increase in error, 7 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 1 a) (/.f64 (*.f64 y b) t)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 a 1)) (/.f64 (*.f64 y b) t))): 0 points increase in error, 0 points decrease in error

    if -4.0000049e-319 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0

    1. Initial program 30.1

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}} \]
      Proof
      (/.f64 (+.f64 x (/.f64 y (/.f64 t z))) (+.f64 (+.f64 a 1) (/.f64 y (/.f64 t b)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) t))) (+.f64 (+.f64 a 1) (/.f64 y (/.f64 t b)))): 21 points increase in error, 21 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)))): 9 points increase in error, 14 points decrease in error
    3. Taylor expanded in b around inf 32.3

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

      \[\leadsto \color{blue}{\frac{t}{b} \cdot \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{y}} \]
      Proof
      (*.f64 (/.f64 t b) (/.f64 (fma.f64 y (/.f64 z t) x) y)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 t b) (/.f64 (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 y (/.f64 z t)) x)) y)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 t b) (/.f64 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y z) t)) x) y)): 20 points increase in error, 3 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (*.f64 b y))): 35 points increase in error, 40 points decrease in error
      (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (Rewrite<= *-commutative_binary64 (*.f64 y b))): 0 points increase in error, 0 points decrease in error
    5. Taylor expanded in t around 0 26.2

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

      \[\leadsto \color{blue}{\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}} \]
      Proof
      (+.f64 (/.f64 z b) (*.f64 (/.f64 t y) (/.f64 x b))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 t x) (*.f64 y b)))): 33 points increase in error, 27 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 t x) (*.f64 y b)) (/.f64 z b))): 0 points increase in error, 0 points decrease in error

    if 9.9999999999999994e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 63.8

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

      \[\leadsto \color{blue}{\frac{x + \frac{y}{t} \cdot z}{1 + \left(a + \frac{y}{t} \cdot b\right)}} \]
      Proof
      (/.f64 (+.f64 x (*.f64 (/.f64 y t) z)) (+.f64 1 (+.f64 a (*.f64 (/.f64 y t) b)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y z) t))) (+.f64 1 (+.f64 a (*.f64 (/.f64 y t) b)))): 25 points increase in error, 20 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 1 (+.f64 a (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y b) t))))): 9 points increase in error, 7 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 1 a) (/.f64 (*.f64 y b) t)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 a 1)) (/.f64 (*.f64 y b) t))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in y around inf 12.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -\infty:\\ \;\;\;\;\frac{z - \frac{t}{\frac{-y}{x}}}{b}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -5 \cdot 10^{-57}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -4 \cdot 10^{-319}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 0:\\ \;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 10^{+304}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error7.0
Cost4684
\[\begin{array}{l} t_1 := x + \frac{y \cdot z}{t}\\ t_2 := \frac{t_1}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t_2 \leq -4 \cdot 10^{-319}:\\ \;\;\;\;\frac{x + \frac{1}{\frac{\frac{t}{y}}{z}}}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{elif}\;t_2 \leq 10^{+304}:\\ \;\;\;\;\frac{t_1}{\left(y \cdot b\right) \cdot \frac{1}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 2
Error7.0
Cost4556
\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t_1 \leq -4 \cdot 10^{-319}:\\ \;\;\;\;\frac{x + \frac{1}{\frac{\frac{t}{y}}{z}}}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{elif}\;t_1 \leq 10^{+304}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 3
Error12.0
Cost1616
\[\begin{array}{l} t_1 := \frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;t \leq -2.8 \cdot 10^{-89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-219}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{elif}\;t \leq 5.4 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-66}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error11.8
Cost1616
\[\begin{array}{l} t_1 := x + z \cdot \frac{y}{t}\\ t_2 := \frac{t_1}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ t_3 := \frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{if}\;t \leq -2.95 \cdot 10^{-92}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-220}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-128}:\\ \;\;\;\;\frac{t_1}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-66}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error11.8
Cost1616
\[\begin{array}{l} t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\ t_2 := x + z \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -2.95 \cdot 10^{-92}:\\ \;\;\;\;\frac{t_2}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-219}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.14 \cdot 10^{-128}:\\ \;\;\;\;\frac{t_2}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-72}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \end{array} \]
Alternative 6
Error23.5
Cost1364
\[\begin{array}{l} t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;t \leq -2.55 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-36}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{-84}:\\ \;\;\;\;\frac{y \cdot z}{t \cdot \left(a + 1\right)}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-63}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error23.5
Cost1364
\[\begin{array}{l} t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;t \leq -1.42 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-35}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-84}:\\ \;\;\;\;\frac{y \cdot z}{t \cdot \left(a + 1\right)}\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{-64}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \end{array} \]
Alternative 8
Error21.0
Cost1364
\[\begin{array}{l} t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{if}\;t \leq -4 \cdot 10^{+191}:\\ \;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t \leq -2.15 \cdot 10^{-85}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.96 \cdot 10^{-219}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-156}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-65}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ \end{array} \]
Alternative 9
Error29.9
Cost1236
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-49}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-49}:\\ \;\;\;\;\frac{y}{\frac{a + 1}{\frac{z}{t}}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+120}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 10
Error27.4
Cost1168
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ t_2 := \frac{z - \frac{t}{\frac{-y}{x}}}{b}\\ \mathbf{if}\;y \leq -1.5 \cdot 10^{-50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{-71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-49}:\\ \;\;\;\;\frac{y}{\frac{a + 1}{\frac{z}{t}}}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+120}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error28.4
Cost1104
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ t_2 := \frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{if}\;y \leq -5 \cdot 10^{-50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-49}:\\ \;\;\;\;\frac{y}{\frac{a + 1}{\frac{z}{t}}}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+120}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error37.6
Cost984
\[\begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{+121}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq -92000000:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 10^{-194}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 4.7 \cdot 10^{-70}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 330000:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 13
Error20.7
Cost968
\[\begin{array}{l} t_1 := \frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{if}\;b \leq -8.2 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-5}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error29.7
Cost848
\[\begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{elif}\;y \leq -4.9 \cdot 10^{-51}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+121}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 15
Error30.1
Cost840
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -1.85 \cdot 10^{+77}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-84}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;t \leq 1.92 \cdot 10^{-62}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error29.9
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-49}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+120}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 17
Error36.7
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -0.000106:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 18
Error51.3
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022325 
(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))))