Average Error: 22.8 → 22.8
Time: 6.4s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\left(x \cdot y + z \cdot \left(t - a\right)\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r646648 = x;
        double r646649 = y;
        double r646650 = r646648 * r646649;
        double r646651 = z;
        double r646652 = t;
        double r646653 = a;
        double r646654 = r646652 - r646653;
        double r646655 = r646651 * r646654;
        double r646656 = r646650 + r646655;
        double r646657 = b;
        double r646658 = r646657 - r646649;
        double r646659 = r646651 * r646658;
        double r646660 = r646649 + r646659;
        double r646661 = r646656 / r646660;
        return r646661;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r646662 = x;
        double r646663 = y;
        double r646664 = r646662 * r646663;
        double r646665 = z;
        double r646666 = t;
        double r646667 = a;
        double r646668 = r646666 - r646667;
        double r646669 = r646665 * r646668;
        double r646670 = r646664 + r646669;
        double r646671 = 1.0;
        double r646672 = b;
        double r646673 = r646672 - r646663;
        double r646674 = r646665 * r646673;
        double r646675 = r646663 + r646674;
        double r646676 = r646671 / r646675;
        double r646677 = r646670 * r646676;
        return r646677;
}

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

Original22.8
Target17.7
Herbie22.8
\[\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 22.8

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

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

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

Reproduce

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