Average Error: 22.9 → 23.1
Time: 1.2m
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\frac{\frac{1}{y + \left(b - y\right) \cdot z}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\frac{\frac{1}{y + \left(b - y\right) \cdot z}}{\frac{1}{x \cdot y + z \cdot \left(t - a\right)}}
double f(double x, double y, double z, double t, double a, double b) {
        double r38617814 = x;
        double r38617815 = y;
        double r38617816 = r38617814 * r38617815;
        double r38617817 = z;
        double r38617818 = t;
        double r38617819 = a;
        double r38617820 = r38617818 - r38617819;
        double r38617821 = r38617817 * r38617820;
        double r38617822 = r38617816 + r38617821;
        double r38617823 = b;
        double r38617824 = r38617823 - r38617815;
        double r38617825 = r38617817 * r38617824;
        double r38617826 = r38617815 + r38617825;
        double r38617827 = r38617822 / r38617826;
        return r38617827;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r38617828 = 1.0;
        double r38617829 = y;
        double r38617830 = b;
        double r38617831 = r38617830 - r38617829;
        double r38617832 = z;
        double r38617833 = r38617831 * r38617832;
        double r38617834 = r38617829 + r38617833;
        double r38617835 = r38617828 / r38617834;
        double r38617836 = x;
        double r38617837 = r38617836 * r38617829;
        double r38617838 = t;
        double r38617839 = a;
        double r38617840 = r38617838 - r38617839;
        double r38617841 = r38617832 * r38617840;
        double r38617842 = r38617837 + r38617841;
        double r38617843 = r38617828 / r38617842;
        double r38617844 = r38617835 / r38617843;
        return r38617844;
}

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

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

    \[\leadsto \color{blue}{\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
  4. Using strategy rm
  5. Applied div-inv23.1

    \[\leadsto \frac{1}{\color{blue}{\left(y + z \cdot \left(b - y\right)\right) \cdot \frac{1}{x \cdot y + z \cdot \left(t - a\right)}}}\]
  6. Applied associate-/r*23.1

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

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

Reproduce

herbie shell --seed 2019200 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

  (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))