Average Error: 0.0 → 0.0
Time: 11.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 r24125 = 2.0;
        double r24126 = 1.0;
        double r24127 = x;
        double r24128 = r24126 - r24127;
        double r24129 = r24126 + r24127;
        double r24130 = r24128 / r24129;
        double r24131 = sqrt(r24130);
        double r24132 = atan(r24131);
        double r24133 = r24125 * r24132;
        return r24133;
}

double f(double x) {
        double r24134 = 2.0;
        double r24135 = 1.0;
        double r24136 = x;
        double r24137 = r24135 - r24136;
        double r24138 = r24135 + r24136;
        double r24139 = r24137 / r24138;
        double r24140 = log1p(r24139);
        double r24141 = expm1(r24140);
        double r24142 = sqrt(r24141);
        double r24143 = atan(r24142);
        double r24144 = r24134 * r24143;
        return r24144;
}

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