Average Error: 16.2 → 5.2
Time: 23.5s
Precision: binary64
Cost: 6740
\[\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)}\\ t_2 := \frac{y}{\frac{t \cdot \left(\left(a + 1\right) + y \cdot \frac{b}{t}\right)}{z}}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-308}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{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))))
        (t_2 (/ y (/ (* t (+ (+ a 1.0) (* y (/ b t)))) z))))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -2e-308)
       t_1
       (if (<= t_1 0.0)
         (+ (/ (* x (/ t b)) y) (/ z b))
         (if (<= t_1 2e+305)
           t_1
           (if (<= t_1 INFINITY) t_2 (+ (/ z b) (* x (/ (/ t y) 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 t_2 = y / ((t * ((a + 1.0) + (y * (b / t)))) / z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -2e-308) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = ((x * (t / b)) / y) + (z / b);
	} else if (t_1 <= 2e+305) {
		tmp = t_1;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = t_2;
	} else {
		tmp = (z / b) + (x * ((t / y) / 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 t_2 = y / ((t * ((a + 1.0) + (y * (b / t)))) / z);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 <= -2e-308) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = ((x * (t / b)) / y) + (z / b);
	} else if (t_1 <= 2e+305) {
		tmp = t_1;
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else {
		tmp = (z / b) + (x * ((t / y) / 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))
	t_2 = y / ((t * ((a + 1.0) + (y * (b / t)))) / z)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = t_2
	elif t_1 <= -2e-308:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = ((x * (t / b)) / y) + (z / b)
	elif t_1 <= 2e+305:
		tmp = t_1
	elif t_1 <= math.inf:
		tmp = t_2
	else:
		tmp = (z / b) + (x * ((t / y) / 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)))
	t_2 = Float64(y / Float64(Float64(t * Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))) / z))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -2e-308)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(Float64(x * Float64(t / b)) / y) + Float64(z / b));
	elseif (t_1 <= 2e+305)
		tmp = t_1;
	elseif (t_1 <= Inf)
		tmp = t_2;
	else
		tmp = Float64(Float64(z / b) + Float64(x * Float64(Float64(t / y) / 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));
	t_2 = y / ((t * ((a + 1.0) + (y * (b / t)))) / z);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = t_2;
	elseif (t_1 <= -2e-308)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = ((x * (t / b)) / y) + (z / b);
	elseif (t_1 <= 2e+305)
		tmp = t_1;
	elseif (t_1 <= Inf)
		tmp = t_2;
	else
		tmp = (z / b) + (x * ((t / y) / 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]}, Block[{t$95$2 = N[(y / N[(N[(t * N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-308], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(x * N[(t / b), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+305], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(z / b), $MachinePrecision] + N[(x * N[(N[(t / y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $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)}\\
t_2 := \frac{y}{\frac{t \cdot \left(\left(a + 1\right) + y \cdot \frac{b}{t}\right)}{z}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-308}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;t_1\\

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

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.2
Target13.0
Herbie5.2
\[\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 4 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or 1.9999999999999999e305 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 63.7

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

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

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

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

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.9999999999999998e-308 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.9999999999999999e305

    1. Initial program 0.4

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

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

    1. Initial program 27.5

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

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

      \[\leadsto \color{blue}{\frac{t \cdot \left(\frac{y \cdot z}{t} + x\right)}{y \cdot b}} \]
    4. Applied egg-rr27.7

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

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

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

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

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

    1. Initial program 64.0

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{1 + \mathsf{fma}\left(\frac{y}{t}, b, a\right)}} \]
      Proof
      (/.f64 (fma.f64 (/.f64 y t) z x) (+.f64 1 (fma.f64 (/.f64 y t) b a))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y t) z) x)) (+.f64 1 (fma.f64 (/.f64 y t) b a))): 0 points increase in error, 9 points decrease in error
      (/.f64 (+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y z) t)) x) (+.f64 1 (fma.f64 (/.f64 y t) b a))): 9 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 y z) t))) (+.f64 1 (fma.f64 (/.f64 y t) b a))): 0 points increase in error, 7 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 1 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y t) b) a)))): 0 points increase in error, 9 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 1 (+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y b) t)) a))): 9 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 (/.f64 (*.f64 y b) t) a) 1))): 0 points increase in error, 9 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= associate-+r+_binary64 (+.f64 (/.f64 (*.f64 y b) t) (+.f64 a 1)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))): 0 points increase in error, 0 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. Taylor expanded in t around 0 4.7

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

      \[\leadsto \color{blue}{\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{b}} \]
      Proof
      (+.f64 (/.f64 z b) (*.f64 x (/.f64 (/.f64 t y) b))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (*.f64 x (Rewrite<= associate-/r*_binary64 (/.f64 t (*.f64 y b))))): 5 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 t (*.f64 y b)) x))): 0 points increase in error, 5 points decrease in error
      (+.f64 (/.f64 z b) (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 t x) (*.f64 y b)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 t x) (*.f64 y b)) (/.f64 z b))): 5 points increase in error, 0 points decrease in error
  3. Recombined 4 regimes into one program.
  4. Final simplification5.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -\infty:\\ \;\;\;\;\frac{y}{\frac{t \cdot \left(\left(a + 1\right) + y \cdot \frac{b}{t}\right)}{z}}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq -2 \cdot 10^{-308}:\\ \;\;\;\;\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 0:\\ \;\;\;\;\frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 2 \cdot 10^{+305}:\\ \;\;\;\;\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 \infty:\\ \;\;\;\;\frac{y}{\frac{t \cdot \left(\left(a + 1\right) + y \cdot \frac{b}{t}\right)}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error21.3
Cost1488
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-116}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+61}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{1 + \frac{y \cdot b}{t}}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+79}:\\ \;\;\;\;\frac{y}{\frac{t \cdot \left(\left(a + 1\right) + y \cdot \frac{b}{t}\right)}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error27.4
Cost1364
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ t_2 := \frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{if}\;y \leq -8 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{-9}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{elif}\;y \leq -1.28 \cdot 10^{-21}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{-130}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+33}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error14.5
Cost1353
\[\begin{array}{l} \mathbf{if}\;y \leq -3.15 \cdot 10^{+81} \lor \neg \left(y \leq 4.2 \cdot 10^{+79}\right):\\ \;\;\;\;\frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\ \end{array} \]
Alternative 4
Error12.4
Cost1353
\[\begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{+121} \lor \neg \left(y \leq 4.2 \cdot 10^{+79}\right):\\ \;\;\;\;\frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \end{array} \]
Alternative 5
Error28.2
Cost1236
\[\begin{array}{l} t_1 := \frac{x}{1 + \frac{y \cdot b}{t}}\\ t_2 := \frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{if}\;a \leq -3.65 \cdot 10^{+19}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -7.8 \cdot 10^{-212}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.46 \cdot 10^{-249}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 1.52 \cdot 10^{-80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2 \cdot 10^{+46}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error28.2
Cost1236
\[\begin{array}{l} t_1 := \frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{if}\;a \leq -3.65 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a}\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-212}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -5.6 \cdot 10^{-250}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+46}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\ \end{array} \]
Alternative 7
Error27.8
Cost1236
\[\begin{array}{l} t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\ t_2 := \frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{if}\;y \leq -7.5 \cdot 10^{+77}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -0.00018:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-21}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-132}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error37.3
Cost1117
\[\begin{array}{l} \mathbf{if}\;a \leq -1:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq -7.8 \cdot 10^{-212}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-249}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-81}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{+47} \lor \neg \left(a \leq 1.5 \cdot 10^{+106}\right) \land a \leq 1.25 \cdot 10^{+164}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 9
Error27.7
Cost1100
\[\begin{array}{l} t_1 := \frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{if}\;y \leq -3.9 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{+32}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error27.4
Cost1100
\[\begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+76}:\\ \;\;\;\;\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-130}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + x \cdot \frac{\frac{t}{y}}{b}\\ \end{array} \]
Alternative 11
Error29.4
Cost972
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+78}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-130}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+69}:\\ \;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 12
Error22.1
Cost969
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+120} \lor \neg \left(y \leq 9 \cdot 10^{+48}\right):\\ \;\;\;\;\frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\ \end{array} \]
Alternative 13
Error20.2
Cost969
\[\begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+80} \lor \neg \left(y \leq 2.3 \cdot 10^{+79}\right):\\ \;\;\;\;\frac{x \cdot \frac{t}{b}}{y} + \frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \end{array} \]
Alternative 14
Error28.2
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+79}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+62}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 15
Error37.0
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -1:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{+36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 16
Error50.8
Cost64
\[x \]

Error

Reproduce

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