Average Error: 0.0 → 0.0
Time: 7.0s
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 r17277 = 2.0;
        double r17278 = 1.0;
        double r17279 = x;
        double r17280 = r17278 - r17279;
        double r17281 = r17278 + r17279;
        double r17282 = r17280 / r17281;
        double r17283 = sqrt(r17282);
        double r17284 = atan(r17283);
        double r17285 = r17277 * r17284;
        return r17285;
}

double f(double x) {
        double r17286 = 2.0;
        double r17287 = 1.0;
        double r17288 = x;
        double r17289 = r17287 - r17288;
        double r17290 = r17287 + r17288;
        double r17291 = r17289 / r17290;
        double r17292 = log1p(r17291);
        double r17293 = expm1(r17292);
        double r17294 = sqrt(r17293);
        double r17295 = atan(r17294);
        double r17296 = r17286 * r17295;
        return r17296;
}

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 2019350 +o rules:numerics
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))