Average Error: 16.5 → 15.1
Time: 4.7s
Precision: 64
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
\[\begin{array}{l} \mathbf{if}\;t \le -9.3618690804013134 \cdot 10^{-114}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\ \mathbf{elif}\;t \le 3.61118246991306439 \cdot 10^{-221}:\\ \;\;\;\;\frac{1}{\sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}} \cdot \sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}}} \cdot \frac{x + \frac{y \cdot z}{t}}{\sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{\frac{z}{t}}{\frac{1}{y}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \end{array}\]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
\mathbf{if}\;t \le -9.3618690804013134 \cdot 10^{-114}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\

\mathbf{elif}\;t \le 3.61118246991306439 \cdot 10^{-221}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}} \cdot \sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}}} \cdot \frac{x + \frac{y \cdot z}{t}}{\sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{\frac{z}{t}}{\frac{1}{y}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\

\end{array}
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 VAR;
	if ((t <= -9.361869080401313e-114)) {
		VAR = ((x + (y / (t / z))) / ((a + 1.0) + (y / (t / b))));
	} else {
		double VAR_1;
		if ((t <= 3.6111824699130644e-221)) {
			VAR_1 = ((1.0 / (cbrt(((a + 1.0) + ((y * b) / t))) * cbrt(((a + 1.0) + ((y * b) / t))))) * ((x + ((y * z) / t)) / cbrt(((a + 1.0) + ((y * b) / t)))));
		} else {
			VAR_1 = ((x + ((z / t) / (1.0 / y))) / ((a + 1.0) + ((y * b) / t)));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.5
Target13.1
Herbie15.1
\[\begin{array}{l} \mathbf{if}\;t \lt -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 \lt 3.0369671037372459 \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 t < -9.361869080401313e-114

    1. Initial program 11.4

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    4. Using strategy rm
    5. Applied associate-/l*7.1

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

    if -9.361869080401313e-114 < t < 3.6111824699130644e-221

    1. Initial program 28.9

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt29.3

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

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

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

    if 3.6111824699130644e-221 < t

    1. Initial program 14.4

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

      \[\leadsto \frac{x + \color{blue}{\frac{y}{\frac{t}{z}}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    4. Using strategy rm
    5. Applied clear-num14.2

      \[\leadsto \frac{x + \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y}}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    6. Using strategy rm
    7. Applied div-inv14.2

      \[\leadsto \frac{x + \frac{1}{\color{blue}{\frac{t}{z} \cdot \frac{1}{y}}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    8. Applied associate-/r*14.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -9.3618690804013134 \cdot 10^{-114}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\ \mathbf{elif}\;t \le 3.61118246991306439 \cdot 10^{-221}:\\ \;\;\;\;\frac{1}{\sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}} \cdot \sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}}} \cdot \frac{x + \frac{y \cdot z}{t}}{\sqrt[3]{\left(a + 1\right) + \frac{y \cdot b}{t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{\frac{z}{t}}{\frac{1}{y}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020092 
(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 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b)))))))

  (/ (+ x (/ (* y z) t)) (+ (+ a 1) (/ (* y b) t))))