Average Error: 0.0 → 0.0
Time: 8.0s
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 - x}{1 \cdot 1 - x \cdot 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 - x}{1 \cdot 1 - x \cdot x}}\right)
double f(double x) {
        double r14138 = 2.0;
        double r14139 = 1.0;
        double r14140 = x;
        double r14141 = r14139 - r14140;
        double r14142 = r14139 + r14140;
        double r14143 = r14141 / r14142;
        double r14144 = sqrt(r14143);
        double r14145 = atan(r14144);
        double r14146 = r14138 * r14145;
        return r14146;
}

double f(double x) {
        double r14147 = 2.0;
        double r14148 = 1.0;
        double r14149 = x;
        double r14150 = r14148 - r14149;
        double r14151 = r14148 * r14148;
        double r14152 = r14149 * r14149;
        double r14153 = r14151 - r14152;
        double r14154 = r14150 / r14153;
        double r14155 = r14150 * r14154;
        double r14156 = sqrt(r14155);
        double r14157 = atan(r14156);
        double r14158 = r14147 * r14157;
        return r14158;
}

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 flip-+0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\frac{1 \cdot 1 - x \cdot x}{1 - x}}}}\right)\]
  4. Applied associate-/r/0.0

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

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

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))