Average Error: 0.0 → 0.0
Time: 4.1s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right)
double f(double x) {
        double r16187 = 2.0;
        double r16188 = 1.0;
        double r16189 = x;
        double r16190 = r16188 - r16189;
        double r16191 = r16188 + r16189;
        double r16192 = r16190 / r16191;
        double r16193 = sqrt(r16192);
        double r16194 = atan(r16193);
        double r16195 = r16187 * r16194;
        return r16195;
}

double f(double x) {
        double r16196 = 2.0;
        double r16197 = 1.0;
        double r16198 = x;
        double r16199 = r16197 - r16198;
        double r16200 = r16197 + r16198;
        double r16201 = r16199 / r16200;
        double r16202 = log1p(r16201);
        double r16203 = expm1(r16202);
        double r16204 = sqrt(r16203);
        double r16205 = atan(r16204);
        double r16206 = r16196 * r16205;
        return r16206;
}

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 2 \cdot \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right)\]

Reproduce

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