Average Error: 16.3 → 12.7
Time: 6.2s
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 -2.3732692961566745 \cdot 10^{+89} \lor \neg \left(t \leq 1.0329017281745015 \cdot 10^{+43}\right):\\ \;\;\;\;\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{else}:\\ \;\;\;\;\frac{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 -2.3732692961566745 \cdot 10^{+89} \lor \neg \left(t \leq 1.0329017281745015 \cdot 10^{+43}\right):\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{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 -2.3732692961566745e+89) (not (<= t 1.0329017281745015e+43)))
   (/
    (+ x (* (/ y (* (cbrt t) (cbrt t))) (/ z (cbrt t))))
    (+ (+ a 1.0) (* y (/ b t))))
   (/ (+ 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 <= -2.3732692961566745e+89) || !(t <= 1.0329017281745015e+43)) {
		tmp = (x + ((y / (cbrt(t) * cbrt(t))) * (z / cbrt(t)))) / ((a + 1.0) + (y * (b / t)));
	} else {
		tmp = (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.3
Target13.5
Herbie12.7
\[\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 < -2.37326929615667447e89 or 1.0329017281745015e43 < t

    1. Initial program 11.7

      \[\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_binary64_2122011.7

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

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

      \[\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-cbrt_binary64_212558.3

      \[\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-frac_binary64_212262.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 -2.37326929615667447e89 < t < 1.0329017281745015e43

    1. Initial program 19.4

      \[\frac{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.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3732692961566745 \cdot 10^{+89} \lor \neg \left(t \leq 1.0329017281745015 \cdot 10^{+43}\right):\\ \;\;\;\;\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{else}:\\ \;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\ \end{array}\]

Reproduce

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