Average Error: 0.0 → 0.0
Time: 27.7s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}\right) \cdot 2
double f(double x) {
        double r717957 = 2.0;
        double r717958 = 1.0;
        double r717959 = x;
        double r717960 = r717958 - r717959;
        double r717961 = r717958 + r717959;
        double r717962 = r717960 / r717961;
        double r717963 = sqrt(r717962);
        double r717964 = atan(r717963);
        double r717965 = r717957 * r717964;
        return r717965;
}

double f(double x) {
        double r717966 = 1.0;
        double r717967 = x;
        double r717968 = r717966 - r717967;
        double r717969 = r717966 + r717967;
        double r717970 = r717968 / r717969;
        double r717971 = expm1(r717970);
        double r717972 = log1p(r717971);
        double r717973 = sqrt(r717972);
        double r717974 = atan(r717973);
        double r717975 = 2.0;
        double r717976 = r717974 * r717975;
        return r717976;
}

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

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Using strategy rm
  3. Applied log1p-expm1-u0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}}\right)\]
  4. Final simplification0.0

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

Reproduce

herbie shell --seed 2019121 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))