Average Error: 22.8 → 23.0
Time: 5.9s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.92360889968386784 \cdot 10^{233}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(t - a\right) + x \cdot y\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}\\ \end{array}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;x \le -1.92360889968386784 \cdot 10^{233}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(t - a\right) + x \cdot y\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r878983 = x;
        double r878984 = y;
        double r878985 = r878983 * r878984;
        double r878986 = z;
        double r878987 = t;
        double r878988 = a;
        double r878989 = r878987 - r878988;
        double r878990 = r878986 * r878989;
        double r878991 = r878985 + r878990;
        double r878992 = b;
        double r878993 = r878992 - r878984;
        double r878994 = r878986 * r878993;
        double r878995 = r878984 + r878994;
        double r878996 = r878991 / r878995;
        return r878996;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r878997 = x;
        double r878998 = -1.9236088996838678e+233;
        bool r878999 = r878997 <= r878998;
        double r879000 = z;
        double r879001 = t;
        double r879002 = a;
        double r879003 = r879001 - r879002;
        double r879004 = r879000 * r879003;
        double r879005 = y;
        double r879006 = r878997 * r879005;
        double r879007 = r879004 + r879006;
        double r879008 = 1.0;
        double r879009 = b;
        double r879010 = r879009 - r879005;
        double r879011 = r879000 * r879010;
        double r879012 = r879005 + r879011;
        double r879013 = r879008 / r879012;
        double r879014 = r879007 * r879013;
        double r879015 = r878999 ? r878997 : r879014;
        return r879015;
}

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.8
Target17.7
Herbie23.0
\[\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. Split input into 2 regimes
  2. if x < -1.9236088996838678e+233

    1. Initial program 37.8

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

      \[\leadsto \frac{\color{blue}{z \cdot \left(t - a\right) + x \cdot y}}{y + z \cdot \left(b - y\right)}\]
    4. Taylor expanded around 0 40.9

      \[\leadsto \color{blue}{x}\]

    if -1.9236088996838678e+233 < x

    1. Initial program 21.8

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

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

      \[\leadsto \color{blue}{\left(z \cdot \left(t - a\right) + x \cdot y\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.92360889968386784 \cdot 10^{233}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(t - a\right) + x \cdot y\right) \cdot \frac{1}{y + z \cdot \left(b - y\right)}\\ \end{array}\]

Reproduce

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