Average Error: 0.0 → 0.0
Time: 8.6s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\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(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{1 - x}{1 + x}}\right)\right)\right)
double f(double x) {
        double r18988 = 2.0;
        double r18989 = 1.0;
        double r18990 = x;
        double r18991 = r18989 - r18990;
        double r18992 = r18989 + r18990;
        double r18993 = r18991 / r18992;
        double r18994 = sqrt(r18993);
        double r18995 = atan(r18994);
        double r18996 = r18988 * r18995;
        return r18996;
}

double f(double x) {
        double r18997 = 2.0;
        double r18998 = 1.0;
        double r18999 = x;
        double r19000 = r18998 - r18999;
        double r19001 = r18998 + r18999;
        double r19002 = r19000 / r19001;
        double r19003 = sqrt(r19002);
        double r19004 = log1p(r19003);
        double r19005 = expm1(r19004);
        double r19006 = atan(r19005);
        double r19007 = r18997 * r19006;
        return r19007;
}

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

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

Reproduce

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