Average Error: 23.4 → 23.4
Time: 7.3s
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 r737059 = x;
        double r737060 = y;
        double r737061 = r737059 * r737060;
        double r737062 = z;
        double r737063 = t;
        double r737064 = a;
        double r737065 = r737063 - r737064;
        double r737066 = r737062 * r737065;
        double r737067 = r737061 + r737066;
        double r737068 = b;
        double r737069 = r737068 - r737060;
        double r737070 = r737062 * r737069;
        double r737071 = r737060 + r737070;
        double r737072 = r737067 / r737071;
        return r737072;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r737073 = x;
        double r737074 = y;
        double r737075 = r737073 * r737074;
        double r737076 = z;
        double r737077 = t;
        double r737078 = a;
        double r737079 = r737077 - r737078;
        double r737080 = r737076 * r737079;
        double r737081 = r737075 + r737080;
        double r737082 = 1.0;
        double r737083 = b;
        double r737084 = r737083 - r737074;
        double r737085 = r737076 * r737084;
        double r737086 = r737074 + r737085;
        double r737087 = r737082 / r737086;
        double r737088 = r737081 * r737087;
        return r737088;
}

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.4
Target18.4
Herbie23.4
\[\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.4

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

    \[\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 simplification23.4

    \[\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 2019353 
(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)))))