Average Error: 16.4 → 13.0
Time: 6.7s
Precision: binary64
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.5878578969715667 \cdot 10^{56}:\\ \;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\ \mathbf{elif}\;t \le 9.2372602525465489 \cdot 10^{51}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + \sqrt[3]{y \cdot \frac{b}{t}} \cdot \left(\sqrt[3]{y \cdot \frac{b}{t}} \cdot \sqrt[3]{y \cdot \frac{b}{t}}\right)\right)}\\ \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 -1.5878578969715667 \cdot 10^{56}:\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\

\mathbf{elif}\;t \le 9.2372602525465489 \cdot 10^{51}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\

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

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (((double) (x + ((double) (((double) (y * z)) / t)))) / ((double) (((double) (a + 1.0)) + ((double) (((double) (y * b)) / t))))));
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if ((t <= -1.5878578969715667e+56)) {
		VAR = ((double) (((double) (x + ((double) (y * ((double) (z / t)))))) * ((double) (1.0 / ((double) (a + ((double) (1.0 + ((double) (y * ((double) (b / t))))))))))));
	} else {
		double VAR_1;
		if ((t <= 9.237260252546549e+51)) {
			VAR_1 = ((double) (((double) (x + ((double) (((double) (y * z)) / t)))) / ((double) (((double) (a + 1.0)) + ((double) (((double) (y * b)) / t))))));
		} else {
			VAR_1 = ((double) (((double) (x + ((double) (y * ((double) (z / t)))))) / ((double) (a + ((double) (1.0 + ((double) (((double) cbrt(((double) (y * ((double) (b / t)))))) * ((double) (((double) cbrt(((double) (y * ((double) (b / t)))))) * ((double) cbrt(((double) (y * ((double) (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.4
Target13.4
Herbie13.0
\[\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 < -1.5878578969715667e56

    1. Initial program 12.0

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}}\]
    3. Using strategy rm
    4. Applied div-inv3.0

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

    if -1.5878578969715667e56 < t < 9.2372602525465489e51

    1. Initial program 20.3

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

    if 9.2372602525465489e51 < t

    1. Initial program 10.3

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

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

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

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

Reproduce

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