Average Error: 0.0 → 0.0
Time: 2.6s
Precision: binary64
\[\frac{-\left(f + n\right)}{f - n}\]
\[\log \left({e}^{\left(\frac{f + n}{n - f}\right)}\right)\]
\frac{-\left(f + n\right)}{f - n}
\log \left({e}^{\left(\frac{f + n}{n - f}\right)}\right)
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
(FPCore (f n) :precision binary64 (log (pow E (/ (+ f n) (- n f)))))
double code(double f, double n) {
	return (((double) -(((double) (f + n)))) / ((double) (f - n)));
}
double code(double f, double n) {
	return ((double) log(((double) pow(((double) M_E), (((double) (f + n)) / ((double) (n - f)))))));
}

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 Error: 0.0 bits

    \[\frac{-\left(f + n\right)}{f - n}\]
  2. SimplifiedError: 0.0 bits

    \[\leadsto \color{blue}{\frac{f + n}{n - f}}\]
  3. Using strategy rm
  4. Applied add-log-expError: 0.0 bits

    \[\leadsto \color{blue}{\log \left(e^{\frac{f + n}{n - f}}\right)}\]
  5. Using strategy rm
  6. Applied *-un-lft-identityError: 0.0 bits

    \[\leadsto \log \left(e^{\frac{f + n}{\color{blue}{1 \cdot \left(n - f\right)}}}\right)\]
  7. Applied *-un-lft-identityError: 0.0 bits

    \[\leadsto \log \left(e^{\frac{\color{blue}{1 \cdot \left(f + n\right)}}{1 \cdot \left(n - f\right)}}\right)\]
  8. Applied times-fracError: 0.0 bits

    \[\leadsto \log \left(e^{\color{blue}{\frac{1}{1} \cdot \frac{f + n}{n - f}}}\right)\]
  9. Applied exp-prodError: 0.0 bits

    \[\leadsto \log \color{blue}{\left({\left(e^{\frac{1}{1}}\right)}^{\left(\frac{f + n}{n - f}\right)}\right)}\]
  10. SimplifiedError: 0.0 bits

    \[\leadsto \log \left({\color{blue}{e}}^{\left(\frac{f + n}{n - f}\right)}\right)\]
  11. Final simplificationError: 0.0 bits

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

Reproduce

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