Average Error: 16.2 → 14.9
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}\;y \le 12155024933432426:\\ \;\;\;\;\left(x + \frac{y \cdot z}{t}\right) \cdot \frac{1}{\left(a + 1\right) + \left(y \cdot b\right) \cdot \frac{1}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}}{\left(a + 1\right) + y \cdot \frac{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}\;y \le 12155024933432426:\\
\;\;\;\;\left(x + \frac{y \cdot z}{t}\right) \cdot \frac{1}{\left(a + 1\right) + \left(y \cdot b\right) \cdot \frac{1}{t}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}}{\left(a + 1\right) + y \cdot \frac{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 temp;
	if ((y <= 12155024933432426.0)) {
		temp = ((x + ((y * z) / t)) * (1.0 / ((a + 1.0) + ((y * b) * (1.0 / t)))));
	} else {
		temp = ((x + ((y / (cbrt(t) * cbrt(t))) * (z / cbrt(t)))) / ((a + 1.0) + (y * (b / t))));
	}
	return temp;
}

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.2
Target13.2
Herbie14.9
\[\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 2 regimes
  2. if y < 12155024933432426.0

    1. Initial program 12.1

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

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

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

    if 12155024933432426.0 < y

    1. Initial program 29.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-cbrt30.2

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

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

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

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

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

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

Reproduce

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