Average Error: 0.0 → 0.0
Time: 2.4m
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 r6616562 = f;
        double r6616563 = n;
        double r6616564 = r6616562 + r6616563;
        double r6616565 = -r6616564;
        double r6616566 = r6616562 - r6616563;
        double r6616567 = r6616565 / r6616566;
        return r6616567;
}

double f(double f, double n) {
        double r6616568 = exp(1.0);
        double r6616569 = f;
        double r6616570 = n;
        double r6616571 = r6616569 + r6616570;
        double r6616572 = -r6616571;
        double r6616573 = r6616569 - r6616570;
        double r6616574 = r6616572 / r6616573;
        double r6616575 = pow(r6616568, r6616574);
        double r6616576 = log(r6616575);
        return r6616576;
}

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^{\frac{-\left(f + n\right)}{f - \color{blue}{1 \cdot n}}}\right)\]
  6. Applied *-un-lft-identity0.0

    \[\leadsto \log \left(e^{\frac{-\left(f + n\right)}{\color{blue}{1 \cdot f} - 1 \cdot n}}\right)\]
  7. Applied distribute-lft-out--0.0

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

    \[\leadsto \log \left(e^{\frac{-\color{blue}{1 \cdot \left(f + n\right)}}{1 \cdot \left(f - n\right)}}\right)\]
  9. Applied distribute-rgt-neg-in0.0

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

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

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

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

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

Reproduce

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