Average Error: 0.0 → 0.0
Time: 2.2m
Precision: 64
\[\frac{-\left(f + n\right)}{f - n}\]
\[\log \left({e}^{\left(\frac{-\left(f + n\right)}{f - n}\right)}\right)\]
\frac{-\left(f + n\right)}{f - n}
\log \left({e}^{\left(\frac{-\left(f + n\right)}{f - n}\right)}\right)
double f(double f, double n) {
        double r6571954 = f;
        double r6571955 = n;
        double r6571956 = r6571954 + r6571955;
        double r6571957 = -r6571956;
        double r6571958 = r6571954 - r6571955;
        double r6571959 = r6571957 / r6571958;
        return r6571959;
}

double f(double f, double n) {
        double r6571960 = exp(1.0);
        double r6571961 = f;
        double r6571962 = n;
        double r6571963 = r6571961 + r6571962;
        double r6571964 = -r6571963;
        double r6571965 = r6571961 - r6571962;
        double r6571966 = r6571964 / r6571965;
        double r6571967 = pow(r6571960, r6571966);
        double r6571968 = log(r6571967);
        return r6571968;
}

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 *-un-lft-identity0.0

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

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

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

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

Reproduce

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