Average Error: 16.6 → 6.0
Time: 9.5s
Precision: binary64
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
\[\begin{array}{l} t_1 := \frac{y \cdot b}{t}\\ t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t_1}\\ \mathbf{if}\;t_2 \leq -5.881257533664626 \cdot 10^{-213}:\\ \;\;\;\;\begin{array}{l} t_3 := 1 + \left(a + t_1\right)\\ \frac{\frac{y}{t \cdot t_3}}{\frac{1}{z}} + \frac{x}{t_3} \end{array}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_4 := \frac{x}{1 + \left(a + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}\right)}\\ \mathbf{if}\;t_2 \leq 6.91683988960966 \cdot 10^{+260}:\\ \;\;\;\;\frac{y \cdot z}{y \cdot b + \left(t + t \cdot a\right)} + t_4\\ \mathbf{else}:\\ \;\;\;\;t_4 + \frac{z}{b}\\ \end{array}\\ \end{array} \]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t_1}\\
\mathbf{if}\;t_2 \leq -5.881257533664626 \cdot 10^{-213}:\\
\;\;\;\;\begin{array}{l}
t_3 := 1 + \left(a + t_1\right)\\
\frac{\frac{y}{t \cdot t_3}}{\frac{1}{z}} + \frac{x}{t_3}
\end{array}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_4 := \frac{x}{1 + \left(a + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}\right)}\\
\mathbf{if}\;t_2 \leq 6.91683988960966 \cdot 10^{+260}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + \left(t + t \cdot a\right)} + t_4\\

\mathbf{else}:\\
\;\;\;\;t_4 + \frac{z}{b}\\


\end{array}\\


\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
 (let* ((t_1 (/ (* y b) t)) (t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) t_1))))
   (if (<= t_2 -5.881257533664626e-213)
     (let* ((t_3 (+ 1.0 (+ a t_1))))
       (+ (/ (/ y (* t t_3)) (/ 1.0 z)) (/ x t_3)))
     (let* ((t_4
             (/
              x
              (+ 1.0 (+ a (* (/ y (* (cbrt t) (cbrt t))) (/ b (cbrt t))))))))
       (if (<= t_2 6.91683988960966e+260)
         (+ (/ (* y z) (+ (* y b) (+ t (* t a)))) t_4)
         (+ t_4 (/ 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 t_1 = (y * b) / t;
	double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
	double tmp;
	if (t_2 <= -5.881257533664626e-213) {
		double t_3_1 = 1.0 + (a + t_1);
		tmp = ((y / (t * t_3_1)) / (1.0 / z)) + (x / t_3_1);
	} else {
		double t_4 = x / (1.0 + (a + ((y / (cbrt(t) * cbrt(t))) * (b / cbrt(t)))));
		double tmp_2;
		if (t_2 <= 6.91683988960966e+260) {
			tmp_2 = ((y * z) / ((y * b) + (t + (t * a)))) + t_4;
		} else {
			tmp_2 = t_4 + (z / b);
		}
		tmp = tmp_2;
	}
	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.6
Target13.3
Herbie6.0
\[\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 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.8812575336646258e-213

    1. Initial program 8.2

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

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

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

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

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

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

    if -5.8812575336646258e-213 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 6.91683988960965953e260

    1. Initial program 10.0

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

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

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

      \[\leadsto \frac{y \cdot z}{\left(1 + \left(a + \frac{y \cdot b}{t}\right)\right) \cdot t} + \frac{x}{1 + \left(a + \color{blue}{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}}\right)} \]
    5. Taylor expanded in z around inf 6.9

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

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

    1. Initial program 59.4

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

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

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

      \[\leadsto \frac{y \cdot z}{\left(1 + \left(a + \frac{y \cdot b}{t}\right)\right) \cdot t} + \frac{x}{1 + \left(a + \color{blue}{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}}\right)} \]
    5. Taylor expanded in y around inf 11.1

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

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

Reproduce

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