Average Error: 0.0 → 0.0
Time: 35.5s
Precision: 64
\[\frac{x + 1.0}{1.0 - x}\]
\[\log \left(e^{\frac{1.0 + x}{1.0 - x}}\right)\]
\frac{x + 1.0}{1.0 - x}
\log \left(e^{\frac{1.0 + x}{1.0 - x}}\right)
double f(double x) {
        double r1835321 = x;
        double r1835322 = 1.0;
        double r1835323 = r1835321 + r1835322;
        double r1835324 = r1835322 - r1835321;
        double r1835325 = r1835323 / r1835324;
        return r1835325;
}

double f(double x) {
        double r1835326 = 1.0;
        double r1835327 = x;
        double r1835328 = r1835326 + r1835327;
        double r1835329 = r1835326 - r1835327;
        double r1835330 = r1835328 / r1835329;
        double r1835331 = exp(r1835330);
        double r1835332 = log(r1835331);
        return r1835332;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{x + 1.0}{1.0 - x}\]
  2. Using strategy rm
  3. Applied add-log-exp0.0

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

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

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  (/ (+ x 1.0) (- 1.0 x)))