Average Error: 0.0 → 0.0
Time: 16.3s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\log \left(e^{\frac{1 - x}{1 + x}}\right)\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(\log \left(e^{\frac{1 - x}{1 + x}}\right)\right)\right)}\right) \cdot 2
double f(double x) {
        double r711284 = 2.0;
        double r711285 = 1.0;
        double r711286 = x;
        double r711287 = r711285 - r711286;
        double r711288 = r711285 + r711286;
        double r711289 = r711287 / r711288;
        double r711290 = sqrt(r711289);
        double r711291 = atan(r711290);
        double r711292 = r711284 * r711291;
        return r711292;
}

double f(double x) {
        double r711293 = 1.0;
        double r711294 = x;
        double r711295 = r711293 - r711294;
        double r711296 = r711293 + r711294;
        double r711297 = r711295 / r711296;
        double r711298 = exp(r711297);
        double r711299 = log(r711298);
        double r711300 = log1p(r711299);
        double r711301 = expm1(r711300);
        double r711302 = sqrt(r711301);
        double r711303 = atan(r711302);
        double r711304 = 2.0;
        double r711305 = r711303 * r711304;
        return r711305;
}

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. Using strategy rm
  5. Applied add-log-exp0.0

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

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

Reproduce

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