Average Error: 23.6 → 23.7
Time: 5.3s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\left(x \cdot y + \left(t - a\right) \cdot z\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 + \left(t - a\right) \cdot z\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 r870162 = x;
        double r870163 = y;
        double r870164 = r870162 * r870163;
        double r870165 = z;
        double r870166 = t;
        double r870167 = a;
        double r870168 = r870166 - r870167;
        double r870169 = r870165 * r870168;
        double r870170 = r870164 + r870169;
        double r870171 = b;
        double r870172 = r870171 - r870163;
        double r870173 = r870165 * r870172;
        double r870174 = r870163 + r870173;
        double r870175 = r870170 / r870174;
        return r870175;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r870176 = x;
        double r870177 = y;
        double r870178 = r870176 * r870177;
        double r870179 = t;
        double r870180 = a;
        double r870181 = r870179 - r870180;
        double r870182 = z;
        double r870183 = r870181 * r870182;
        double r870184 = r870178 + r870183;
        double r870185 = 1.0;
        double r870186 = b;
        double r870187 = r870186 - r870177;
        double r870188 = r870182 * r870187;
        double r870189 = r870177 + r870188;
        double r870190 = r870185 / r870189;
        double r870191 = r870184 * r870190;
        return r870191;
}

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

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

    \[\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. Using strategy rm
  5. Applied *-commutative23.7

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

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

Reproduce

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