Average Error: 0.0 → 0.0
Time: 14.8s
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 r24984 = 2.0;
        double r24985 = 1.0;
        double r24986 = x;
        double r24987 = r24985 - r24986;
        double r24988 = r24985 + r24986;
        double r24989 = r24987 / r24988;
        double r24990 = sqrt(r24989);
        double r24991 = atan(r24990);
        double r24992 = r24984 * r24991;
        return r24992;
}

double f(double x) {
        double r24993 = 2.0;
        double r24994 = 1.0;
        double r24995 = r24994 * r24994;
        double r24996 = x;
        double r24997 = r24996 * r24996;
        double r24998 = r24995 - r24997;
        double r24999 = sqrt(r24998);
        double r25000 = r24994 + r24996;
        double r25001 = r24999 / r25000;
        double r25002 = fabs(r25001);
        double r25003 = atan(r25002);
        double r25004 = r24993 * r25003;
        return r25004;
}

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 2019199 
(FPCore (x)
  :name "arccos"
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))