Average Error: 0.0 → 0.0
Time: 8.9s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\left(\mathsf{log1p}\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{expm1}\left(\left(\mathsf{log1p}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}\right) \cdot 2
double f(double x) {
        double r206065 = 2.0;
        double r206066 = 1.0;
        double r206067 = x;
        double r206068 = r206066 - r206067;
        double r206069 = r206066 + r206067;
        double r206070 = r206068 / r206069;
        double r206071 = sqrt(r206070);
        double r206072 = atan(r206071);
        double r206073 = r206065 * r206072;
        return r206073;
}

double f(double x) {
        double r206074 = 1.0;
        double r206075 = x;
        double r206076 = r206074 - r206075;
        double r206077 = r206074 + r206075;
        double r206078 = r206076 / r206077;
        double r206079 = log1p(r206078);
        double r206080 = expm1(r206079);
        double r206081 = sqrt(r206080);
        double r206082 = atan(r206081);
        double r206083 = 2.0;
        double r206084 = r206082 * r206083;
        return r206084;
}

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(\left(\mathsf{log1p}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}}\right)\]
  4. Final simplification0.0

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

Reproduce

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