Average Error: 23.3 → 23.4
Time: 6.6s
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 r836112 = x;
        double r836113 = y;
        double r836114 = r836112 * r836113;
        double r836115 = z;
        double r836116 = t;
        double r836117 = a;
        double r836118 = r836116 - r836117;
        double r836119 = r836115 * r836118;
        double r836120 = r836114 + r836119;
        double r836121 = b;
        double r836122 = r836121 - r836113;
        double r836123 = r836115 * r836122;
        double r836124 = r836113 + r836123;
        double r836125 = r836120 / r836124;
        return r836125;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r836126 = x;
        double r836127 = y;
        double r836128 = r836126 * r836127;
        double r836129 = z;
        double r836130 = t;
        double r836131 = a;
        double r836132 = r836130 - r836131;
        double r836133 = r836129 * r836132;
        double r836134 = r836128 + r836133;
        double r836135 = 1.0;
        double r836136 = b;
        double r836137 = r836136 - r836127;
        double r836138 = r836129 * r836137;
        double r836139 = r836127 + r836138;
        double r836140 = r836135 / r836139;
        double r836141 = r836134 * r836140;
        return r836141;
}

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
Target17.8
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.3

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