Average Error: 0.0 → 0.8
Time: 9.2s
Precision: 64
\[\frac{x + 1}{1 - x}\]
\[\mathsf{expm1}\left(\sqrt[3]{{\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right)}^{3}}\right)\]
\frac{x + 1}{1 - x}
\mathsf{expm1}\left(\sqrt[3]{{\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right)}^{3}}\right)
double f(double x) {
        double r29086 = x;
        double r29087 = 1.0;
        double r29088 = r29086 + r29087;
        double r29089 = r29087 - r29086;
        double r29090 = r29088 / r29089;
        return r29090;
}

double f(double x) {
        double r29091 = x;
        double r29092 = 1.0;
        double r29093 = r29091 + r29092;
        double r29094 = r29092 - r29091;
        double r29095 = r29093 / r29094;
        double r29096 = log1p(r29095);
        double r29097 = 3.0;
        double r29098 = pow(r29096, r29097);
        double r29099 = cbrt(r29098);
        double r29100 = expm1(r29099);
        return r29100;
}

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}{1 - x}\]
  2. Using strategy rm
  3. Applied expm1-log1p-u0.8

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right)}\]
  4. Using strategy rm
  5. Applied add-cbrt-cube0.8

    \[\leadsto \mathsf{expm1}\left(\color{blue}{\sqrt[3]{\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right) \cdot \mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right) \cdot \mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)}}\right)\]
  6. Simplified0.8

    \[\leadsto \mathsf{expm1}\left(\sqrt[3]{\color{blue}{{\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right)}^{3}}}\right)\]
  7. Final simplification0.8

    \[\leadsto \mathsf{expm1}\left(\sqrt[3]{{\left(\mathsf{log1p}\left(\frac{x + 1}{1 - x}\right)\right)}^{3}}\right)\]

Reproduce

herbie shell --seed 2019350 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  :precision binary64
  (/ (+ x 1) (- 1 x)))