Average Error: 16.6 → 12.8
Time: 5.5s
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 -1.41038955379196806 \cdot 10^{48}:\\ \;\;\;\;\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}}\\ \mathbf{elif}\;t \le 2.6314109640294897 \cdot 10^{-36}:\\ \;\;\;\;\frac{x + \frac{z \cdot y}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\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}\;t \le -1.41038955379196806 \cdot 10^{48}:\\
\;\;\;\;\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}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\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 VAR;
	if ((t <= -1.410389553791968e+48)) {
		VAR = ((x + ((y / (cbrt(t) * cbrt(t))) * (z / cbrt(t)))) / ((a + 1.0) + (y * (b / t))));
	} else {
		double VAR_1;
		if ((t <= 2.6314109640294897e-36)) {
			VAR_1 = ((x + ((z * y) / t)) / ((a + 1.0) + ((y * b) / t)));
		} else {
			VAR_1 = ((x + (y / (t / z))) / ((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.6
Target13.1
Herbie12.8
\[\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.410389553791968e+48

    1. Initial program 11.6

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity11.6

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

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

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

      \[\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) + y \cdot \frac{b}{t}}\]
    8. Applied times-frac2.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) + y \cdot \frac{b}{t}}\]

    if -1.410389553791968e+48 < t < 2.6314109640294897e-36

    1. Initial program 21.6

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

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

    if 2.6314109640294897e-36 < t

    1. Initial program 11.3

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.41038955379196806 \cdot 10^{48}:\\ \;\;\;\;\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}}\\ \mathbf{elif}\;t \le 2.6314109640294897 \cdot 10^{-36}:\\ \;\;\;\;\frac{x + \frac{z \cdot y}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\ \end{array}\]

Reproduce

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