Average Error: 0.0 → 0.0
Time: 4.2s
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 \left(\frac{1}{\sqrt{1 + x}} \cdot \frac{1}{\sqrt{1 + x}}\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \left(\frac{1}{\sqrt{1 + x}} \cdot \frac{1}{\sqrt{1 + x}}\right)}\right)
double f(double x) {
        double r12334 = 2.0;
        double r12335 = 1.0;
        double r12336 = x;
        double r12337 = r12335 - r12336;
        double r12338 = r12335 + r12336;
        double r12339 = r12337 / r12338;
        double r12340 = sqrt(r12339);
        double r12341 = atan(r12340);
        double r12342 = r12334 * r12341;
        return r12342;
}

double f(double x) {
        double r12343 = 2.0;
        double r12344 = 1.0;
        double r12345 = x;
        double r12346 = r12344 - r12345;
        double r12347 = 1.0;
        double r12348 = r12344 + r12345;
        double r12349 = sqrt(r12348);
        double r12350 = r12347 / r12349;
        double r12351 = r12350 * r12350;
        double r12352 = r12346 * r12351;
        double r12353 = sqrt(r12352);
        double r12354 = atan(r12353);
        double r12355 = r12343 * r12354;
        return r12355;
}

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. Using strategy rm
  7. Applied div-inv0.0

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

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

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

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

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

Reproduce

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