Average Error: 0.0 → 0.0
Time: 14.6s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2
double f(double x) {
        double r622060 = 2.0;
        double r622061 = 1.0;
        double r622062 = x;
        double r622063 = r622061 - r622062;
        double r622064 = r622061 + r622062;
        double r622065 = r622063 / r622064;
        double r622066 = sqrt(r622065);
        double r622067 = atan(r622066);
        double r622068 = r622060 * r622067;
        return r622068;
}

double f(double x) {
        double r622069 = 1.0;
        double r622070 = x;
        double r622071 = r622069 - r622070;
        double r622072 = r622069 + r622070;
        double r622073 = r622071 / r622072;
        double r622074 = log1p(r622073);
        double r622075 = expm1(r622074);
        double r622076 = sqrt(r622075);
        double r622077 = atan(r622076);
        double r622078 = 2.0;
        double r622079 = r622077 * r622078;
        return r622079;
}

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 expm1-log1p-u0.0

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

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

Reproduce

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