Average Error: 21.9 → 21.9
Time: 15.9s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\frac{x \cdot y + \left(t - a\right) \cdot z}{y + \left(b - y\right) \cdot z}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\frac{x \cdot y + \left(t - a\right) \cdot z}{y + \left(b - y\right) \cdot z}
double f(double x, double y, double z, double t, double a, double b) {
        double r42737939 = x;
        double r42737940 = y;
        double r42737941 = r42737939 * r42737940;
        double r42737942 = z;
        double r42737943 = t;
        double r42737944 = a;
        double r42737945 = r42737943 - r42737944;
        double r42737946 = r42737942 * r42737945;
        double r42737947 = r42737941 + r42737946;
        double r42737948 = b;
        double r42737949 = r42737948 - r42737940;
        double r42737950 = r42737942 * r42737949;
        double r42737951 = r42737940 + r42737950;
        double r42737952 = r42737947 / r42737951;
        return r42737952;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r42737953 = x;
        double r42737954 = y;
        double r42737955 = r42737953 * r42737954;
        double r42737956 = t;
        double r42737957 = a;
        double r42737958 = r42737956 - r42737957;
        double r42737959 = z;
        double r42737960 = r42737958 * r42737959;
        double r42737961 = r42737955 + r42737960;
        double r42737962 = b;
        double r42737963 = r42737962 - r42737954;
        double r42737964 = r42737963 * r42737959;
        double r42737965 = r42737954 + r42737964;
        double r42737966 = r42737961 / r42737965;
        return r42737966;
}

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

Original21.9
Target16.7
Herbie21.9
\[\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 21.9

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

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

    \[\leadsto \color{blue}{\left(x \cdot y + \left(t - a\right) \cdot z\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}}\]
  6. Using strategy rm
  7. Applied associate-*r/21.9

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

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

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

Reproduce

herbie shell --seed 2019164 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"

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

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