Average Error: 16.1 → 12.9
Time: 7.3s
Precision: binary64
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
\[\begin{array}{l} \mathbf{if}\;t \leq -1.4321878169708876 \cdot 10^{-55} \lor \neg \left(t \leq 4.5828853116986545 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{x + \frac{y \cdot z}{t}} \cdot \sqrt[3]{x + \frac{y \cdot z}{t}}\right) \cdot \frac{\sqrt[3]{x + \frac{y \cdot z}{t}}}{\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 \leq -1.4321878169708876 \cdot 10^{-55} \lor \neg \left(t \leq 4.5828853116986545 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\

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

\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
 (if (or (<= t -1.4321878169708876e-55) (not (<= t 4.5828853116986545e-18)))
   (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (/ y (/ t b))))
   (*
    (* (cbrt (+ x (/ (* y z) t))) (cbrt (+ x (/ (* y z) t))))
    (/ (cbrt (+ x (/ (* y z) t))) (+ (+ a 1.0) (/ (* y b) t))))))
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 tmp;
	if ((t <= -1.4321878169708876e-55) || !(t <= 4.5828853116986545e-18)) {
		tmp = (x + (y * (z / t))) / ((a + 1.0) + (y / (t / b)));
	} else {
		tmp = (cbrt(x + ((y * z) / t)) * cbrt(x + ((y * z) / t))) * (cbrt(x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)));
	}
	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.1
Target12.9
Herbie12.9
\[\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 2 regimes
  2. if t < -1.43218781697088762e-55 or 4.5828853116986545e-18 < t

    1. Initial program 11.1

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

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

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

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

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

    if -1.43218781697088762e-55 < t < 4.5828853116986545e-18

    1. Initial program 23.2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4321878169708876 \cdot 10^{-55} \lor \neg \left(t \leq 4.5828853116986545 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{x + \frac{y \cdot z}{t}} \cdot \sqrt[3]{x + \frac{y \cdot z}{t}}\right) \cdot \frac{\sqrt[3]{x + \frac{y \cdot z}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \end{array}\]

Reproduce

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