Average Error: 16.5 → 4.5
Time: 8.0s
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{1}{\frac{t}{b \cdot y}}\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{1}{\frac{t}{b \cdot y}}\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 (/ 1.0 (/ t (* b y))))))))
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 + (1.0 / (t / (b * y))))));
}

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.5
Target13.0
Herbie4.5
\[\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.5

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

    \[\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. Simplified15.2

    \[\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*_binary6413.2

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

    \[\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 8.0

    \[\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. Simplified4.5

    \[\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. Using strategy rm
  10. Applied clear-num_binary644.5

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

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

Alternatives

Reproduce

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