Average Error: 0.0 → 0.0
Time: 2.6s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\left|\frac{\sqrt{1 \cdot 1 - x \cdot x}}{1 + x}\right|\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\left|\frac{\sqrt{1 \cdot 1 - x \cdot x}}{1 + x}\right|\right)
double f(double x) {
        double r7208 = 2.0;
        double r7209 = 1.0;
        double r7210 = x;
        double r7211 = r7209 - r7210;
        double r7212 = r7209 + r7210;
        double r7213 = r7211 / r7212;
        double r7214 = sqrt(r7213);
        double r7215 = atan(r7214);
        double r7216 = r7208 * r7215;
        return r7216;
}

double f(double x) {
        double r7217 = 2.0;
        double r7218 = 1.0;
        double r7219 = r7218 * r7218;
        double r7220 = x;
        double r7221 = r7220 * r7220;
        double r7222 = r7219 - r7221;
        double r7223 = sqrt(r7222);
        double r7224 = r7218 + r7220;
        double r7225 = r7223 / r7224;
        double r7226 = fabs(r7225);
        double r7227 = atan(r7226);
        double r7228 = r7217 * r7227;
        return r7228;
}

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 add-sqr-sqrt0.0

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

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

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\frac{\sqrt{1 - x}}{\sqrt{1 + x}} \cdot \frac{\sqrt{1 - x}}{\sqrt{1 + x}}}}\right)\]
  6. Applied rem-sqrt-square0.0

    \[\leadsto 2 \cdot \tan^{-1} \color{blue}{\left(\left|\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right|\right)}\]
  7. Using strategy rm
  8. Applied flip--0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\left|\frac{\sqrt{\color{blue}{\frac{1 \cdot 1 - x \cdot x}{1 + x}}}}{\sqrt{1 + x}}\right|\right)\]
  9. Applied sqrt-div0.0

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

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

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

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

Reproduce

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