Average Error: 16.9 → 8.2
Time: 17.2s
Precision: binary64
Cost: 8388
\[\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 + \mathsf{fma}\left(y, \frac{b}{t}, 1\right)}\\ \mathbf{elif}\;t_1 \leq 10^{+306}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x}{\frac{b}{t}} - \frac{z}{b} \cdot \frac{a + 1}{\frac{b}{t}}}{y}\\ \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 (fma y (/ b t) 1.0))))
     (if (<= t_1 1e+306)
       (/ (+ x (* z (/ y t))) (+ 1.0 (+ a (* b (/ y t)))))
       (+
        (/ z b)
        (/ (- (/ x (/ b t)) (* (/ z b) (/ (+ a 1.0) (/ b t)))) y))))))
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 + fma(y, (b / t), 1.0)));
	} else if (t_1 <= 1e+306) {
		tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))));
	} else {
		tmp = (z / b) + (((x / (b / t)) - ((z / b) * ((a + 1.0) / (b / t)))) / y);
	}
	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 + fma(y, Float64(b / t), 1.0))));
	elseif (t_1 <= 1e+306)
		tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))));
	else
		tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x / Float64(b / t)) - Float64(Float64(z / b) * Float64(Float64(a + 1.0) / Float64(b / t)))) / y));
	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[(y * N[(b / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], 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], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x / N[(b / t), $MachinePrecision]), $MachinePrecision] - N[(N[(z / b), $MachinePrecision] * N[(N[(a + 1.0), $MachinePrecision] / N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $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)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + \mathsf{fma}\left(y, \frac{b}{t}, 1\right)}\\

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

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


\end{array}

Error

Target

Original16.9
Target13.9
Herbie8.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 3 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. Simplified40.7

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

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

      \[\leadsto \color{blue}{\frac{y}{t} \cdot \frac{z}{a + \mathsf{fma}\left(y, \frac{b}{t}, 1\right)}} \]
      Proof
      (*.f64 (/.f64 y t) (/.f64 z (+.f64 a (fma.f64 y (/.f64 b t) 1)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y t) (/.f64 z (Rewrite=> +-commutative_binary64 (+.f64 (fma.f64 y (/.f64 b t) 1) a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y t) (/.f64 z (+.f64 (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 y (/.f64 b t)) 1)) a))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y t) (/.f64 z (+.f64 (Rewrite=> +-commutative_binary64 (+.f64 1 (*.f64 y (/.f64 b t)))) a))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y t) (/.f64 z (Rewrite<= associate-+r+_binary64 (+.f64 1 (+.f64 (*.f64 y (/.f64 b t)) a))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 y t) (/.f64 z (+.f64 1 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y b) t)) a)))): 8 points increase in error, 14 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 53 points increase in error, 54 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.00000000000000002e306

    1. Initial program 6.0

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

      \[\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)))): 28 points increase in error, 16 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))))): 14 points increase in error, 6 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 1.00000000000000002e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))

    1. Initial program 63.7

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

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

      \[\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. Simplified13.5

      \[\leadsto \color{blue}{\frac{z}{b} + \frac{\frac{x}{\frac{b}{t}} - \frac{1 + a}{\frac{b}{t}} \cdot \frac{z}{b}}{y}} \]
      Proof
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 x (/.f64 b t)) (*.f64 (/.f64 (+.f64 1 a) (/.f64 b t)) (/.f64 z b))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 x t) b)) (*.f64 (/.f64 (+.f64 1 a) (/.f64 b t)) (/.f64 z b))) y)): 11 points increase in error, 6 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 t x)) b) (*.f64 (/.f64 (+.f64 1 a) (/.f64 b t)) (/.f64 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 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (+.f64 1 a) t) b)) (/.f64 z b))) y)): 14 points increase in error, 2 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 t (+.f64 1 a))) b) (/.f64 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 (*.f64 t (+.f64 1 a)) z) (*.f64 b b)))) y)): 25 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 t (*.f64 (+.f64 1 a) z))) (*.f64 b b))) y)): 2 points increase in error, 4 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
  3. Recombined 3 regimes into one program.
  4. Final simplification8.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}{t} \cdot \frac{z}{a + \mathsf{fma}\left(y, \frac{b}{t}, 1\right)}\\ \mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 10^{+306}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x}{\frac{b}{t}} - \frac{z}{b} \cdot \frac{a + 1}{\frac{b}{t}}}{y}\\ \end{array} \]

Alternatives

Alternative 1
Error9.0
Cost2628
\[\begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 10^{+306}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b} + \frac{\frac{x}{\frac{b}{t}} - \frac{z}{b} \cdot \frac{a + 1}{\frac{b}{t}}}{y}\\ \end{array} \]
Alternative 2
Error8.7
Cost2244
\[\begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)} \leq 10^{+306}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 3
Error37.5
Cost2164
\[\begin{array}{l} t_1 := \frac{t}{y} \cdot \frac{x}{b}\\ t_2 := \frac{y}{t} \cdot \frac{z}{a}\\ t_3 := x + \frac{y \cdot z}{t}\\ \mathbf{if}\;a \leq -9.2 \cdot 10^{+191}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -2500:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq -1.22 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -3.05 \cdot 10^{-121}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{-203}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{-261}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-215}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-140}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 4.6 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{-42}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{+76}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 4
Error37.3
Cost2032
\[\begin{array}{l} t_1 := \frac{t}{y} \cdot \frac{x}{b}\\ t_2 := \frac{y}{t} \cdot \frac{z}{a}\\ t_3 := x + \frac{y \cdot z}{t}\\ \mathbf{if}\;a \leq -9.5 \cdot 10^{+191}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1020:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq -1.22 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -6.2 \cdot 10^{-122}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{-202}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-260}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-216}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{-140}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 4.6 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{-94}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+77}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 5
Error28.8
Cost2028
\[\begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{a}\\ t_2 := \frac{y}{t} \cdot \frac{z}{a + 1}\\ t_3 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;z \leq -5.7 \cdot 10^{+211}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+174}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{+119}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 340000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 4.35 \cdot 10^{+77}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+131}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+188}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+198}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+217}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+240}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error30.2
Cost1764
\[\begin{array}{l} t_1 := x + \frac{y \cdot z}{t}\\ t_2 := \frac{t_1}{a}\\ \mathbf{if}\;a \leq -1020:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.46 \cdot 10^{-121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-202}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{-261}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-215}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-140}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.6 \cdot 10^{-134}:\\ \;\;\;\;\frac{t}{y} \cdot \frac{x}{b}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-94}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 920:\\ \;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error23.4
Cost1628
\[\begin{array}{l} t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;b \leq -9.5 \cdot 10^{+120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -3.7 \cdot 10^{+38}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;b \leq -350:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;b \leq 2.45 \cdot 10^{+91}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{+128}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+134}:\\ \;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{+204}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 8
Error23.4
Cost1620
\[\begin{array}{l} t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{+121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -5.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;b \leq -310:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;b \leq 3.7 \cdot 10^{+112}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{+134}:\\ \;\;\;\;\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{y \cdot b}{t}\right)\right)}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{+186}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
Alternative 9
Error37.3
Cost984
\[\begin{array}{l} \mathbf{if}\;a \leq -3.7 \cdot 10^{+140}:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq -8.6 \cdot 10^{-54}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq -4.7 \cdot 10^{-122}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-284}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{elif}\;a \leq 10^{-260}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.12 \cdot 10^{+58}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 10
Error28.4
Cost584
\[\begin{array}{l} t_1 := \frac{x}{a + 1}\\ \mathbf{if}\;t \leq -9 \cdot 10^{-39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-132}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error37.1
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -750000000000:\\ \;\;\;\;\frac{x}{a}\\ \mathbf{elif}\;a \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a}\\ \end{array} \]
Alternative 12
Error51.1
Cost64
\[x \]

Error

Reproduce

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