Average Error: 0.0 → 0.0
Time: 10.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left(e^{\frac{x}{x + y}}\right) - \frac{y}{x + y}\]
\frac{x - y}{x + y}
\log \left(e^{\frac{x}{x + y}}\right) - \frac{y}{x + y}
double f(double x, double y) {
        double r666839 = x;
        double r666840 = y;
        double r666841 = r666839 - r666840;
        double r666842 = r666839 + r666840;
        double r666843 = r666841 / r666842;
        return r666843;
}

double f(double x, double y) {
        double r666844 = x;
        double r666845 = y;
        double r666846 = r666844 + r666845;
        double r666847 = r666844 / r666846;
        double r666848 = exp(r666847);
        double r666849 = log(r666848);
        double r666850 = r666845 / r666846;
        double r666851 = r666849 - r666850;
        return r666851;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\frac{x}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{x + y}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{x + y} - \frac{y}{x + y}}\]
  4. Using strategy rm
  5. Applied add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\frac{x}{x + y}}\right)} - \frac{y}{x + y}\]
  6. Final simplification0.0

    \[\leadsto \log \left(e^{\frac{x}{x + y}}\right) - \frac{y}{x + y}\]

Reproduce

herbie shell --seed 2019198 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"

  :herbie-target
  (- (/ x (+ x y)) (/ y (+ x y)))

  (/ (- x y) (+ x y)))