Average Error: 0.0 → 0.0
Time: 8.6s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\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(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2
double f(double x) {
        double r209790 = 2.0;
        double r209791 = 1.0;
        double r209792 = x;
        double r209793 = r209791 - r209792;
        double r209794 = r209791 + r209792;
        double r209795 = r209793 / r209794;
        double r209796 = sqrt(r209795);
        double r209797 = atan(r209796);
        double r209798 = r209790 * r209797;
        return r209798;
}

double f(double x) {
        double r209799 = 1.0;
        double r209800 = x;
        double r209801 = r209799 - r209800;
        double r209802 = r209799 + r209800;
        double r209803 = r209801 / r209802;
        double r209804 = log1p(r209803);
        double r209805 = expm1(r209804);
        double r209806 = sqrt(r209805);
        double r209807 = atan(r209806);
        double r209808 = 2.0;
        double r209809 = r209807 * r209808;
        return r209809;
}

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 \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2\]

Reproduce

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