Average Error: 0.1 → 0.1
Time: 10.4s
Precision: 64
\[\frac{-1}{b} - \left(\frac{1}{\left(a \cdot b\right) \cdot a} + \frac{1}{a}\right)\]
\[\frac{-1}{b} - \left(\frac{\frac{1}{a}}{\frac{a}{\frac{1}{b}}} + \frac{1}{a}\right)\]
\frac{-1}{b} - \left(\frac{1}{\left(a \cdot b\right) \cdot a} + \frac{1}{a}\right)
\frac{-1}{b} - \left(\frac{\frac{1}{a}}{\frac{a}{\frac{1}{b}}} + \frac{1}{a}\right)
double f(double b, double a) {
        double r2318580 = 1.0;
        double r2318581 = -r2318580;
        double r2318582 = b;
        double r2318583 = r2318581 / r2318582;
        double r2318584 = a;
        double r2318585 = r2318584 * r2318582;
        double r2318586 = r2318585 * r2318584;
        double r2318587 = r2318580 / r2318586;
        double r2318588 = r2318580 / r2318584;
        double r2318589 = r2318587 + r2318588;
        double r2318590 = r2318583 - r2318589;
        return r2318590;
}

double f(double b, double a) {
        double r2318591 = 1.0;
        double r2318592 = -r2318591;
        double r2318593 = b;
        double r2318594 = r2318592 / r2318593;
        double r2318595 = 1.0;
        double r2318596 = a;
        double r2318597 = r2318595 / r2318596;
        double r2318598 = r2318591 / r2318593;
        double r2318599 = r2318596 / r2318598;
        double r2318600 = r2318597 / r2318599;
        double r2318601 = r2318591 / r2318596;
        double r2318602 = r2318600 + r2318601;
        double r2318603 = r2318594 - r2318602;
        return r2318603;
}

Error

Bits error versus b

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{-1}{b} - \left(\frac{1}{\left(a \cdot b\right) \cdot a} + \frac{1}{a}\right)\]
  2. Using strategy rm
  3. Applied associate-/r*0.1

    \[\leadsto \frac{-1}{b} - \left(\color{blue}{\frac{\frac{1}{a \cdot b}}{a}} + \frac{1}{a}\right)\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.1

    \[\leadsto \frac{-1}{b} - \left(\frac{\frac{\color{blue}{1 \cdot 1}}{a \cdot b}}{a} + \frac{1}{a}\right)\]
  6. Applied times-frac0.1

    \[\leadsto \frac{-1}{b} - \left(\frac{\color{blue}{\frac{1}{a} \cdot \frac{1}{b}}}{a} + \frac{1}{a}\right)\]
  7. Applied associate-/l*0.1

    \[\leadsto \frac{-1}{b} - \left(\color{blue}{\frac{\frac{1}{a}}{\frac{a}{\frac{1}{b}}}} + \frac{1}{a}\right)\]
  8. Final simplification0.1

    \[\leadsto \frac{-1}{b} - \left(\frac{\frac{1}{a}}{\frac{a}{\frac{1}{b}}} + \frac{1}{a}\right)\]

Reproduce

herbie shell --seed 1 
(FPCore (b a)
  :name "-1/b-(1/(a*b*a)+1/a)"
  :precision binary64
  (- (/ (- 1) b) (+ (/ 1 (* (* a b) a)) (/ 1 a))))