Average Error: 16.8 → 7.9
Time: 24.7s
Precision: binary64
Cost: 14788
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
\[\begin{array}{l} t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t_2 \leq -4 \cdot 10^{-306}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{a + \mathsf{fma}\left(\frac{y}{t}, b, 1\right)}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+292}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (/ (+ z (/ t (/ y x))) b))
        (t_2 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
   (if (<= t_2 -4e-306)
     (/ (fma (/ y t) z x) (+ a (fma (/ y t) b 1.0)))
     (if (<= t_2 0.0) t_1 (if (<= t_2 5e+292) t_2 t_1)))))
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 = (z + (t / (y / x))) / b;
	double t_2 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	double tmp;
	if (t_2 <= -4e-306) {
		tmp = fma((y / t), z, x) / (a + fma((y / t), b, 1.0));
	} else if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 5e+292) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	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(z + Float64(t / Float64(y / x))) / b)
	t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0)))
	tmp = 0.0
	if (t_2 <= -4e-306)
		tmp = Float64(fma(Float64(y / t), z, x) / Float64(a + fma(Float64(y / t), b, 1.0)));
	elseif (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 5e+292)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return 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[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = 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$2, -4e-306], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(a + N[(N[(y / t), $MachinePrecision] * b + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+292], t$95$2, t$95$1]]]]]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_2 \leq -4 \cdot 10^{-306}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{a + \mathsf{fma}\left(\frac{y}{t}, b, 1\right)}\\

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

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t_2\\

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


\end{array}

Error

Target

Original16.8
Target13.4
Herbie7.9
\[\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 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -4.00000000000000011e-306

    1. Initial program 8.4

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

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

    if -4.00000000000000011e-306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 43.1

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Simplified36.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)))): 21 points increase in error, 23 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))))): 10 points increase in error, 9 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 27.0

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

      \[\leadsto \color{blue}{\frac{z}{b} + \frac{\frac{t \cdot x}{b} - \frac{t}{b} \cdot \frac{z + a \cdot z}{b}}{y}} \]
      Proof
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (+.f64 z (*.f64 a z)) b))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (+.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 z)) (*.f64 a z)) b))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 z (+.f64 1 a))) b))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 1 a) z)) b))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (*.f64 b b)))) y)): 19 points increase in error, 7 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (Rewrite<= unpow2_binary64 (pow.f64 b 2)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2))))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (*.f64 (Rewrite<= metadata-eval (*.f64 -1 -1)) (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -1 (*.f64 -1 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (*.f64 -1 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 (*.f64 t x) b)) (*.f64 -1 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 t x) b)) (*.f64 -1 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))) y)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 t x) b)) (*.f64 -1 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))) y)) (/.f64 z b))): 0 points increase in error, 0 points decrease in error
    5. Taylor expanded in x around inf 18.2

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

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

      \[\leadsto \color{blue}{\frac{z + \frac{t}{\frac{y}{x}}}{b}} \]
      Proof
      (/.f64 (+.f64 z (/.f64 t (/.f64 y x))) b): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 z (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 t x) y))) b): 20 points increase in error, 21 points decrease in error
      (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 t x) y) z)) b): 0 points increase in error, 0 points decrease in error

    if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292

    1. Initial program 0.4

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

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

Alternatives

Alternative 1
Error7.9
Cost4556
\[\begin{array}{l} t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t_2 \leq -4 \cdot 10^{-306}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+292}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error23.9
Cost2156
\[\begin{array}{l} t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\ t_2 := \frac{y \cdot b}{t}\\ t_3 := 1 + t_2\\ t_4 := \frac{x}{t_2 + \left(a + 1\right)}\\ t_5 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\ t_6 := \frac{x + \frac{y \cdot z}{t}}{a + 1}\\ t_7 := \frac{y \cdot z}{t \cdot t_3}\\ \mathbf{if}\;y \leq -6.5 \cdot 10^{+117}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{+22}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ \mathbf{elif}\;y \leq -25000000000000:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y \leq -0.00028:\\ \;\;\;\;\frac{z \cdot \frac{y}{t}}{t_3}\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-76}:\\ \;\;\;\;t_6\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-131}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-241}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-265}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{-157}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-157}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;y \leq 2.12 \cdot 10^{+145}:\\ \;\;\;\;t_6\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error23.3
Cost1760
\[\begin{array}{l} t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\ t_2 := \frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ t_3 := \frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ \mathbf{if}\;b \leq -3 \cdot 10^{+111}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -6.5 \cdot 10^{+52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -8 \cdot 10^{+35}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.35 \cdot 10^{-33}:\\ \;\;\;\;\frac{x}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \mathbf{elif}\;b \leq -5.9 \cdot 10^{-64}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+141}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+174}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{+198}:\\ \;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error23.2
Cost1760
\[\begin{array}{l} t_1 := \frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ t_2 := \frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ t_3 := \frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{+109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -6 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.8 \cdot 10^{+34}:\\ \;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{-17}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{+97}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{+141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{+174}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 4.5 \cdot 10^{+197}:\\ \;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error21.4
Cost1496
\[\begin{array}{l} t_1 := \frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ \mathbf{if}\;b \leq -9.2 \cdot 10^{+110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -5.6 \cdot 10^{+52}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ \mathbf{elif}\;b \leq -3.8 \cdot 10^{+34}:\\ \;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+141}:\\ \;\;\;\;\frac{x}{a + 1} + \frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+174}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{+196}:\\ \;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error11.3
Cost1352
\[\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 -6.2 \cdot 10^{-112}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.72 \cdot 10^{-189}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error11.5
Cost1352
\[\begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-112}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \mathbf{elif}\;t \leq 2.75 \cdot 10^{-189}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \end{array} \]
Alternative 8
Error11.5
Cost1352
\[\begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-112}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \end{array} \]
Alternative 9
Error29.2
Cost1240
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -1.55 \cdot 10^{-19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-88}:\\ \;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\ \mathbf{elif}\;t \leq 4.9 \cdot 10^{-40}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-21}:\\ \;\;\;\;t \cdot \frac{\frac{x}{b}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error26.0
Cost1232
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{-22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 2.12 \cdot 10^{-134}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\ \mathbf{elif}\;t \leq 10^{+31}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error22.9
Cost1232
\[\begin{array}{l} t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{-23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.35 \cdot 10^{-189}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-134}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+30}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error22.9
Cost1232
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 2.12 \cdot 10^{-134}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\ \mathbf{elif}\;t \leq 10^{+31}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \end{array} \]
Alternative 13
Error27.1
Cost1104
\[\begin{array}{l} t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\ t_2 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -9.5 \cdot 10^{-22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.12 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error26.1
Cost1104
\[\begin{array}{l} t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\ t_2 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{-18}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error26.1
Cost1104
\[\begin{array}{l} t_1 := \frac{z + \frac{x \cdot t}{y}}{b}\\ t_2 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{-20}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-132}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 16
Error26.0
Cost1104
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -2.8 \cdot 10^{-19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 2.12 \cdot 10^{-134}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+31}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error29.3
Cost972
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -1.2 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-101}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error28.6
Cost848
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -9 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-156}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-100}:\\ \;\;\;\;\frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-44}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 19
Error37.1
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{+237}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -5 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+47}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 20
Error28.0
Cost584
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -8.5 \cdot 10^{-21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-42}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 21
Error36.9
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -5.7 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 22
Error51.4
Cost64
\[x \]

Error

Reproduce

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