?

Average Error: 16.7 → 7.5
Time: 26.5s
Precision: binary64
Cost: 15944

?

\[\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{y}{t} \cdot \frac{z}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-313}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{1 + \mathsf{fma}\left(\frac{y}{t}, b, a\right)}\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\left(\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\right) + \frac{z \cdot \left(t \cdot \left(-1 - a\right)\right)}{y \cdot \left(b \cdot b\right)}\\ \mathbf{elif}\;t_1 \leq 10^{+296}:\\ \;\;\;\;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))
     (* (/ y t) (/ z (+ a (+ 1.0 (* b (/ y t))))))
     (if (<= t_1 -2e-313)
       (/ (fma (/ y t) z x) (+ 1.0 (fma (/ y t) b a)))
       (if (<= t_1 0.0)
         (+
          (+ (/ z b) (* (/ t y) (/ x b)))
          (/ (* z (* t (- -1.0 a))) (* y (* b b))))
         (if (<= t_1 1e+296) 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 = (y / t) * (z / (a + (1.0 + (b * (y / t)))));
	} else if (t_1 <= -2e-313) {
		tmp = fma((y / t), z, x) / (1.0 + fma((y / t), b, a));
	} else if (t_1 <= 0.0) {
		tmp = ((z / b) + ((t / y) * (x / b))) + ((z * (t * (-1.0 - a))) / (y * (b * b)));
	} else if (t_1 <= 1e+296) {
		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(y / t) * Float64(z / Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))));
	elseif (t_1 <= -2e-313)
		tmp = Float64(fma(Float64(y / t), z, x) / Float64(1.0 + fma(Float64(y / t), b, a)));
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) + Float64(Float64(z * Float64(t * Float64(-1.0 - a))) / Float64(y * Float64(b * b))));
	elseif (t_1 <= 1e+296)
		tmp = t_1;
	else
		tmp = Float64(z / b);
	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[(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[(y / t), $MachinePrecision] * N[(z / N[(a + N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-313], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(1.0 + N[(N[(y / t), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(t * N[(-1.0 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+296], 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{y}{t} \cdot \frac{z}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-313}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{1 + \mathsf{fma}\left(\frac{y}{t}, b, a\right)}\\

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

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

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


\end{array}

Error?

Target

Original16.7
Target13.4
Herbie7.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. Taylor expanded in x around 0 34.0

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

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

      [Start]34.0

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

      times-frac [=>]18.2

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

      associate-+r+ [=>]18.2

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

      +-commutative [<=]18.2

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

      associate-*l/ [<=]18.2

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

      *-commutative [=>]18.2

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

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

    1. Initial program 0.4

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

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

      [Start]0.4

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

      +-commutative [=>]0.4

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

      associate-*l/ [<=]2.3

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

      fma-def [=>]2.3

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

      +-commutative [=>]2.3

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

      associate-+r+ [=>]2.3

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

      +-commutative [=>]2.3

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

      associate-*l/ [<=]2.3

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

      fma-def [=>]2.3

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

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

    1. Initial program 28.8

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

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

      [Start]28.8

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

      associate-/l* [=>]28.5

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

      associate-+l+ [=>]28.5

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

      associate-/l* [=>]20.3

      \[ \frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \color{blue}{\frac{y}{\frac{t}{b}}}\right)} \]
    3. Taylor expanded in y around inf 28.5

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

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

      [Start]28.5

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

      +-commutative [=>]28.5

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

      times-frac [=>]22.0

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

      associate-*r* [=>]23.9

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

      unpow2 [=>]23.9

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

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

    1. Initial program 0.5

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

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

    1. Initial program 62.8

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

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

      [Start]62.8

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

      +-commutative [=>]62.8

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

      associate-*l/ [<=]55.3

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

      fma-def [=>]55.3

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

      +-commutative [=>]55.3

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

      associate-+r+ [=>]55.3

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

      +-commutative [=>]55.3

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

      associate-*l/ [<=]50.9

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

      fma-def [=>]50.9

      \[ \frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{1 + \color{blue}{\mathsf{fma}\left(\frac{y}{t}, b, a\right)}} \]
    3. Taylor expanded in y around inf 13.3

      \[\leadsto \color{blue}{\frac{z}{b}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification7.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{y}{t} \cdot \frac{z}{a + \left(1 + 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 -2 \cdot 10^{-313}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{1 + \mathsf{fma}\left(\frac{y}{t}, b, a\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 0:\\ \;\;\;\;\left(\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\right) + \frac{z \cdot \left(t \cdot \left(-1 - a\right)\right)}{y \cdot \left(b \cdot b\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 10^{+296}:\\ \;\;\;\;\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
Error6.9
Cost5712
\[\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{y}{t} \cdot \frac{z}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-313}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{t}{y} \cdot \frac{x + \frac{y}{\frac{t}{z}}}{b}\\ \mathbf{elif}\;t_1 \leq 10^{+296}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 2
Error6.5
Cost5712
\[\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{y}{t} \cdot \frac{z}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-313}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{z}{b} + t \cdot \left(\frac{\frac{x}{y}}{b} + \frac{-1 - a}{\frac{y \cdot \left(b \cdot b\right)}{z}}\right)\\ \mathbf{elif}\;t_1 \leq 10^{+296}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 3
Error6.9
Cost5712
\[\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{y}{t} \cdot \frac{z}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-313}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\left(\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\right) + \frac{z \cdot \left(t \cdot \left(-1 - a\right)\right)}{y \cdot \left(b \cdot b\right)}\\ \mathbf{elif}\;t_1 \leq 10^{+296}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 4
Error30.8
Cost2292
\[\begin{array}{l} t_1 := \frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ t_2 := x + z \cdot \frac{y}{t}\\ t_3 := \frac{t_2}{a}\\ t_4 := \frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{if}\;a \leq -3.5 \cdot 10^{+44}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1 \cdot 10^{-88}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{-124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.05 \cdot 10^{-172}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{-283}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 2 \cdot 10^{-250}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-138}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 490000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{+45}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{+132}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+177}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+230}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 5
Error30.6
Cost1633
\[\begin{array}{l} t_1 := \frac{x + z \cdot \frac{y}{t}}{a}\\ t_2 := \frac{x}{1 + \frac{y \cdot b}{t}}\\ \mathbf{if}\;a \leq -6.5 \cdot 10^{+44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-34}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-286}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-250}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-149}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 22500000000000 \lor \neg \left(a \leq 3.8 \cdot 10^{+177}\right) \land a \leq 4.5 \cdot 10^{+230}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error21.3
Cost1488
\[\begin{array}{l} t_1 := \frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{if}\;t \leq -2.05 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{-141}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 140000:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+76}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error23.8
Cost1364
\[\begin{array}{l} t_1 := \frac{x}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\ \mathbf{if}\;t \leq -3.1 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-69}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{elif}\;t \leq 125000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.9 \cdot 10^{+14}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+96}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error14.8
Cost1353
\[\begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{-36} \lor \neg \left(t \leq 2.45 \cdot 10^{-206}\right):\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \end{array} \]
Alternative 9
Error13.0
Cost1353
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-36} \lor \neg \left(t \leq 1.75 \cdot 10^{-205}\right):\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \end{array} \]
Alternative 10
Error29.8
Cost1236
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -3 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.9 \cdot 10^{-141}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 96000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+14}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;t \leq 1.72 \cdot 10^{+96}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error37.6
Cost984
\[\begin{array}{l} \mathbf{if}\;a \leq -2.05 \cdot 10^{+45}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{-33}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-289}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{-149}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+131}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 12
Error20.2
Cost969
\[\begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{-13} \lor \neg \left(t \leq 6.9 \cdot 10^{-141}\right):\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \end{array} \]
Alternative 13
Error20.3
Cost968
\[\begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{-13}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-141}:\\ \;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\ \end{array} \]
Alternative 14
Error29.6
Cost850
\[\begin{array}{l} \mathbf{if}\;t \leq -3.05 \cdot 10^{-6} \lor \neg \left(t \leq 6.2 \cdot 10^{-141}\right) \land \left(t \leq 3600 \lor \neg \left(t \leq 3.75 \cdot 10^{+64}\right)\right):\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 15
Error37.0
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -42000000000:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 16
Error50.9
Cost64
\[x \]

Error

Reproduce?

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