Average Error: 16.8 → 8.8
Time: 14.2s
Precision: binary64
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 1.806063727478945 \cdot 10^{+282}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{b}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array}\]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 1.806063727478945 \cdot 10^{+282}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{b}}}\\

\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
 (if (<=
      (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
      1.806063727478945e+282)
   (/
    (+ x (/ (* y z) t))
    (+
     (+ a 1.0)
     (*
      (/ (* (cbrt y) (cbrt y)) (* (cbrt t) (cbrt t)))
      (/ (cbrt y) (/ (cbrt t) b)))))
   (/ 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 tmp;
	if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 1.806063727478945e+282) {
		tmp = (x + ((y * z) / t)) / ((a + 1.0) + (((cbrt(y) * cbrt(y)) / (cbrt(t) * cbrt(t))) * (cbrt(y) / (cbrt(t) / b))));
	} else {
		tmp = z / b;
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.8
Target13.2
Herbie8.8
\[\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 2 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.80606372747894511e282

    1. Initial program 9.0

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    2. Using strategy rm
    3. Applied associate-/l*_binary64_211659.3

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \color{blue}{\frac{y}{\frac{t}{b}}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity_binary64_212209.3

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{\color{blue}{1 \cdot b}}}}\]
    6. Applied add-cube-cbrt_binary64_212559.5

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{\frac{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}{1 \cdot b}}}\]
    7. Applied times-frac_binary64_212269.5

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{\color{blue}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1} \cdot \frac{\sqrt[3]{t}}{b}}}}\]
    8. Applied add-cube-cbrt_binary64_212559.5

      \[\leadsto \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1} \cdot \frac{\sqrt[3]{t}}{b}}}\]
    9. Applied times-frac_binary64_212267.8

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

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

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

    1. Initial program 60.8

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

      \[\leadsto \color{blue}{\frac{z}{b}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 1.806063727478945 \cdot 10^{+282}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{b}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array}\]

Reproduce

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