Average Error: 23.6 → 23.6
Time: 7.0s
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 r766019 = x;
        double r766020 = y;
        double r766021 = r766019 * r766020;
        double r766022 = z;
        double r766023 = t;
        double r766024 = a;
        double r766025 = r766023 - r766024;
        double r766026 = r766022 * r766025;
        double r766027 = r766021 + r766026;
        double r766028 = b;
        double r766029 = r766028 - r766020;
        double r766030 = r766022 * r766029;
        double r766031 = r766020 + r766030;
        double r766032 = r766027 / r766031;
        return r766032;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r766033 = x;
        double r766034 = y;
        double r766035 = r766033 * r766034;
        double r766036 = z;
        double r766037 = t;
        double r766038 = a;
        double r766039 = r766037 - r766038;
        double r766040 = r766036 * r766039;
        double r766041 = r766035 + r766040;
        double r766042 = 1.0;
        double r766043 = b;
        double r766044 = r766043 - r766034;
        double r766045 = r766036 * r766044;
        double r766046 = r766034 + r766045;
        double r766047 = r766042 / r766046;
        double r766048 = r766041 * r766047;
        return r766048;
}

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

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

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