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

\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-298}:\\
\;\;\;\;t_2\\

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

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

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


\end{array}

Error

Target

Original16.6
Target13.3
Herbie6.1
\[\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.99999999999999985e223

    1. Initial program 39.5

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Taylor expanded in x around 0 23.1

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(\frac{y}{\frac{t}{b}} + a\right)}, \frac{x}{1 + \left(\frac{y}{\frac{t}{b}} + a\right)}\right)} \]
      Proof
      (fma.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (/.f64 y (/.f64 t b)) a))) (/.f64 x (+.f64 1 (+.f64 (/.f64 y (/.f64 t b)) a)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a))) (/.f64 x (+.f64 1 (+.f64 (/.f64 y (/.f64 t b)) a)))): 5 points increase in error, 6 points decrease in error
      (fma.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))) (/.f64 x (+.f64 1 (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a)))): 10 points increase in error, 5 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a)))) (/.f64 x (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))) (/.f64 x (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a)))): 33 points increase in error, 30 points decrease in error

    if -4.99999999999999985e223 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.0000000000000002e-298 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.00000000000000005e301

    1. Initial program 0.4

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

    if -5.0000000000000002e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or 1.00000000000000005e301 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 43.8

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Taylor expanded in x around 0 39.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(\frac{y}{\frac{t}{b}} + a\right)}, \frac{x}{1 + \left(\frac{y}{\frac{t}{b}} + a\right)}\right)} \]
      Proof
      (fma.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (/.f64 y (/.f64 t b)) a))) (/.f64 x (+.f64 1 (+.f64 (/.f64 y (/.f64 t b)) a)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a))) (/.f64 x (+.f64 1 (+.f64 (/.f64 y (/.f64 t b)) a)))): 5 points increase in error, 6 points decrease in error
      (fma.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))) (/.f64 x (+.f64 1 (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a)))): 10 points increase in error, 5 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a)))) (/.f64 x (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))) (/.f64 x (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a)))): 33 points increase in error, 30 points decrease in error
    4. Taylor expanded in b around inf 18.2

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

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

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

Alternatives

Alternative 1
Error6.3
Cost5712
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\ \mathbf{elif}\;t_2 \leq -5 \cdot 10^{-298}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 10^{+301}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error28.2
Cost1632
\[\begin{array}{l} t_1 := x + \frac{y \cdot z}{t}\\ t_2 := \frac{x}{1 + \frac{y}{\frac{t}{b}}}\\ t_3 := \frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{if}\;a \leq -19429.822127752926:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -3.7327587005749145 \cdot 10^{-268}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 5.8585786399102885 \cdot 10^{-285}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 5.535713119667769 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.6432734283134502 \cdot 10^{-242}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 3.2705394939837593 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 6.948954099127655 \cdot 10^{-51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 63994.002844593786:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Error27.9
Cost1632
\[\begin{array}{l} t_1 := \frac{x + z \cdot \frac{y}{t}}{a}\\ t_2 := \frac{z + x \cdot \frac{t}{y}}{b}\\ t_3 := \frac{x}{1 + \frac{y}{\frac{t}{b}}}\\ t_4 := x + \frac{y \cdot z}{t}\\ \mathbf{if}\;a \leq -19429.822127752926:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.0426211494554791 \cdot 10^{-212}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 5.8585786399102885 \cdot 10^{-285}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 5.535713119667769 \cdot 10^{-257}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 1.5657500194047696 \cdot 10^{-242}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 6.775443380557746 \cdot 10^{-180}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 6.948954099127655 \cdot 10^{-51}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 63994.002844593786:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error22.1
Cost1364
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;y \leq -3.3148866073467114 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.346782053885175 \cdot 10^{+69}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq -5.065824103736429 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.675683355563419 \cdot 10^{-243}:\\ \;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ \mathbf{elif}\;y \leq 6.745327137677617 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error21.7
Cost1364
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;y \leq -3.3148866073467114 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.346782053885175 \cdot 10^{+69}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq -5.065824103736429 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.294234415647402 \cdot 10^{-181}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 6.745327137677617 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error21.8
Cost1364
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;y \leq -3.3148866073467114 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.346782053885175 \cdot 10^{+69}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq -5.065824103736429 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.294234415647402 \cdot 10^{-181}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 6.745327137677617 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error21.6
Cost1364
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;y \leq -3.3148866073467114 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.346782053885175 \cdot 10^{+69}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq -5.065824103736429 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.294234415647402 \cdot 10^{-181}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 6.745327137677617 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error21.5
Cost1364
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;y \leq -3.3148866073467114 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.346782053885175 \cdot 10^{+69}:\\ \;\;\;\;\frac{x}{a + 1} + \frac{z}{t} \cdot \frac{y}{a + 1}\\ \mathbf{elif}\;y \leq -5.065824103736429 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.294234415647402 \cdot 10^{-181}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\ \mathbf{elif}\;y \leq 6.745327137677617 \cdot 10^{+108}:\\ \;\;\;\;\frac{x}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error29.1
Cost1236
\[\begin{array}{l} t_1 := x + \frac{y \cdot z}{t}\\ t_2 := \frac{x + z \cdot \frac{y}{t}}{a}\\ \mathbf{if}\;a \leq -19429.822127752926:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -3.7327587005749145 \cdot 10^{-268}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5.8585786399102885 \cdot 10^{-285}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 6.948954099127655 \cdot 10^{-51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 63994.002844593786:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error23.7
Cost1232
\[\begin{array}{l} t_1 := \frac{x + y \cdot \frac{z}{t}}{a + 1}\\ t_2 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;b \leq -1.5996224634915195 \cdot 10^{+293}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.6404852167200436 \cdot 10^{+259}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1192082101820393.3:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 4.1714598204921694 \cdot 10^{+169}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error22.6
Cost1232
\[\begin{array}{l} t_1 := \frac{z + x \cdot \frac{t}{y}}{b}\\ \mathbf{if}\;b \leq -1.5996224634915195 \cdot 10^{+293}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.6404852167200436 \cdot 10^{+259}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\ \mathbf{elif}\;b \leq -1192082101820393.3:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 4.1714598204921694 \cdot 10^{+169}:\\ \;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error31.3
Cost1104
\[\begin{array}{l} \mathbf{if}\;y \leq -3.3148866073467114 \cdot 10^{+145}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -4.0487849377815 \cdot 10^{-28}:\\ \;\;\;\;t \cdot \frac{\frac{x}{b}}{y}\\ \mathbf{elif}\;y \leq -5.915323605758639 \cdot 10^{-33}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq -1.2412455299928977 \cdot 10^{-69}:\\ \;\;\;\;\frac{y \cdot z}{t \cdot \left(a + 1\right)}\\ \mathbf{elif}\;y \leq 3.0964299178114192 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 13
Error36.4
Cost852
\[\begin{array}{l} \mathbf{if}\;a \leq -0.01502619566510362:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq -3.7327587005749145 \cdot 10^{-268}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 8.640334344800669 \cdot 10^{-282}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 6.948954099127655 \cdot 10^{-51}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 63994.002844593786:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 14
Error36.3
Cost852
\[\begin{array}{l} \mathbf{if}\;a \leq -0.01502619566510362:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq -3.7327587005749145 \cdot 10^{-268}:\\ \;\;\;\;x - x \cdot a\\ \mathbf{elif}\;a \leq 8.640334344800669 \cdot 10^{-282}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 6.948954099127655 \cdot 10^{-51}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 63994.002844593786:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 15
Error29.1
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -5.065824103736429 \cdot 10^{-8}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;y \leq 3.0964299178114192 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 16
Error36.7
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -0.01502619566510362:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 1.3102668244796524 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 17
Error51.1
Cost64
\[x \]

Error

Reproduce

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