Average Error: 16.3 → 3.9
Time: 16.2s
Precision: binary64
\[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\]
\[\frac{z}{b + \frac{t}{y} \cdot \left(a + 1\right)} + \frac{x}{a + \left(1 + \frac{b \cdot y}{t}\right)}\]
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\frac{z}{b + \frac{t}{y} \cdot \left(a + 1\right)} + \frac{x}{a + \left(1 + \frac{b \cdot y}{t}\right)}
(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
 (+ (/ z (+ b (* (/ t y) (+ a 1.0)))) (/ x (+ a (+ 1.0 (/ (* b y) 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) {
	return (z / (b + ((t / y) * (a + 1.0)))) + (x / (a + (1.0 + ((b * y) / t))));
}

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
Target12.9
Herbie3.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. Initial program 16.3

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

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

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

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

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

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

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

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

Reproduce

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