Average Error: 0.0 → 0.0
Time: 2.8s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\log \left({e}^{\left(\frac{x}{x + y}\right)}\right) - \log \left({e}^{\left(\frac{y}{x + y}\right)}\right)\]
\frac{x - y}{x + y}
\log \left({e}^{\left(\frac{x}{x + y}\right)}\right) - \log \left({e}^{\left(\frac{y}{x + y}\right)}\right)
double f(double x, double y) {
        double r794889 = x;
        double r794890 = y;
        double r794891 = r794889 - r794890;
        double r794892 = r794889 + r794890;
        double r794893 = r794891 / r794892;
        return r794893;
}

double f(double x, double y) {
        double r794894 = exp(1.0);
        double r794895 = x;
        double r794896 = y;
        double r794897 = r794895 + r794896;
        double r794898 = r794895 / r794897;
        double r794899 = pow(r794894, r794898);
        double r794900 = log(r794899);
        double r794901 = r794896 / r794897;
        double r794902 = pow(r794894, r794901);
        double r794903 = log(r794902);
        double r794904 = r794900 - r794903;
        return r794904;
}

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 add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\frac{x - y}{x + y}}\right)}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.0

    \[\leadsto \log \left(e^{\frac{x - y}{\color{blue}{1 \cdot \left(x + y\right)}}}\right)\]
  6. Applied *-un-lft-identity0.0

    \[\leadsto \log \left(e^{\frac{\color{blue}{1 \cdot \left(x - y\right)}}{1 \cdot \left(x + y\right)}}\right)\]
  7. Applied times-frac0.0

    \[\leadsto \log \left(e^{\color{blue}{\frac{1}{1} \cdot \frac{x - y}{x + y}}}\right)\]
  8. Applied exp-prod0.0

    \[\leadsto \log \color{blue}{\left({\left(e^{\frac{1}{1}}\right)}^{\left(\frac{x - y}{x + y}\right)}\right)}\]
  9. Simplified0.0

    \[\leadsto \log \left({\color{blue}{e}}^{\left(\frac{x - y}{x + y}\right)}\right)\]
  10. Using strategy rm
  11. Applied div-sub0.0

    \[\leadsto \log \left({e}^{\color{blue}{\left(\frac{x}{x + y} - \frac{y}{x + y}\right)}}\right)\]
  12. Applied pow-sub0.0

    \[\leadsto \log \color{blue}{\left(\frac{{e}^{\left(\frac{x}{x + y}\right)}}{{e}^{\left(\frac{y}{x + y}\right)}}\right)}\]
  13. Applied log-div0.0

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

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

Reproduce

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

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

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