Average Error: 0.0 → 0.0
Time: 9.3s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1}{1 + x}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1}{1 + x}}\right)
double f(double x) {
        double r13660 = 2.0;
        double r13661 = 1.0;
        double r13662 = x;
        double r13663 = r13661 - r13662;
        double r13664 = r13661 + r13662;
        double r13665 = r13663 / r13664;
        double r13666 = sqrt(r13665);
        double r13667 = atan(r13666);
        double r13668 = r13660 * r13667;
        return r13668;
}

double f(double x) {
        double r13669 = 2.0;
        double r13670 = 1.0;
        double r13671 = x;
        double r13672 = r13670 - r13671;
        double r13673 = 1.0;
        double r13674 = r13670 + r13671;
        double r13675 = r13673 / r13674;
        double r13676 = r13672 * r13675;
        double r13677 = sqrt(r13676);
        double r13678 = atan(r13677);
        double r13679 = r13669 * r13678;
        return r13679;
}

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 div-inv0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\left(1 - x\right) \cdot \frac{1}{1 + x}}}\right)\]
  4. Final simplification0.0

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

Reproduce

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