Average Error: 0.0 → 0.0
Time: 16.0s
Precision: 64
\[\frac{-\left(f + n\right)}{f - n}\]
\[\log \left(e^{\frac{1}{\log \left(e^{\frac{f - n}{-\left(f + n\right)}}\right)}}\right)\]
\frac{-\left(f + n\right)}{f - n}
\log \left(e^{\frac{1}{\log \left(e^{\frac{f - n}{-\left(f + n\right)}}\right)}}\right)
double f(double f, double n) {
        double r32897 = f;
        double r32898 = n;
        double r32899 = r32897 + r32898;
        double r32900 = -r32899;
        double r32901 = r32897 - r32898;
        double r32902 = r32900 / r32901;
        return r32902;
}

double f(double f, double n) {
        double r32903 = 1.0;
        double r32904 = f;
        double r32905 = n;
        double r32906 = r32904 - r32905;
        double r32907 = r32904 + r32905;
        double r32908 = -r32907;
        double r32909 = r32906 / r32908;
        double r32910 = exp(r32909);
        double r32911 = log(r32910);
        double r32912 = r32903 / r32911;
        double r32913 = exp(r32912);
        double r32914 = log(r32913);
        return r32914;
}

Error

Bits error versus f

Bits error versus n

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{-\left(f + n\right)}{f - n}\]
  2. Using strategy rm
  3. Applied add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\frac{-\left(f + n\right)}{f - n}}\right)}\]
  4. Using strategy rm
  5. Applied clear-num0.0

    \[\leadsto \log \left(e^{\color{blue}{\frac{1}{\frac{f - n}{-\left(f + n\right)}}}}\right)\]
  6. Using strategy rm
  7. Applied add-log-exp0.0

    \[\leadsto \log \left(e^{\frac{1}{\color{blue}{\log \left(e^{\frac{f - n}{-\left(f + n\right)}}\right)}}}\right)\]
  8. Final simplification0.0

    \[\leadsto \log \left(e^{\frac{1}{\log \left(e^{\frac{f - n}{-\left(f + n\right)}}\right)}}\right)\]

Reproduce

herbie shell --seed 2019212 
(FPCore (f n)
  :name "subtraction fraction"
  :precision binary64
  (/ (- (+ f n)) (- f n)))