Average Error: 23.3 → 22.6
Time: 7.7s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\frac{1}{\frac{\frac{\mathsf{fma}\left(b, z, y\right)}{1}}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)} - \frac{z}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y}}}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\frac{1}{\frac{\frac{\mathsf{fma}\left(b, z, y\right)}{1}}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)} - \frac{z}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y}}}
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (((double) (((double) (x * y)) + ((double) (z * ((double) (t - a)))))) / ((double) (y + ((double) (z * ((double) (b - y))))))));
}
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (1.0 / ((double) (((double) (((double) (((double) fma(b, z, y)) / 1.0)) / ((double) fma(x, y, ((double) (z * ((double) (t - a)))))))) - ((double) (z / ((double) (((double) fma(x, y, ((double) (z * ((double) (t - a)))))) / 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

Original23.3
Target18.2
Herbie22.6
\[\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}\]

Derivation

  1. Initial program 23.3

    \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
  2. Using strategy rm
  3. Applied sub-neg23.3

    \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b + \left(-y\right)\right)}}\]
  4. Applied distribute-lft-in23.4

    \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{\left(z \cdot b + z \cdot \left(-y\right)\right)}}\]
  5. Using strategy rm
  6. Applied clear-num23.5

    \[\leadsto \color{blue}{\frac{1}{\frac{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
  7. Using strategy rm
  8. Applied distribute-rgt-neg-out23.5

    \[\leadsto \frac{1}{\frac{y + \left(z \cdot b + \color{blue}{\left(-z \cdot y\right)}\right)}{x \cdot y + z \cdot \left(t - a\right)}}\]
  9. Applied unsub-neg23.5

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

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

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

    \[\leadsto \frac{1}{\color{blue}{\frac{\frac{\mathsf{fma}\left(b, z, y\right)}{1}}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}} - \frac{z \cdot y}{x \cdot y + z \cdot \left(t - a\right)}}\]
  13. Simplified22.6

    \[\leadsto \frac{1}{\frac{\frac{\mathsf{fma}\left(b, z, y\right)}{1}}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)} - \color{blue}{\frac{z}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y}}}}\]
  14. Final simplification22.6

    \[\leadsto \frac{1}{\frac{\frac{\mathsf{fma}\left(b, z, y\right)}{1}}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)} - \frac{z}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y}}}\]

Reproduce

herbie shell --seed 2020122 +o rules:numerics
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

  (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))