Average Error: 0.0 → 0.0
Time: 4.7s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{\sqrt{1 + x}}} \cdot \sqrt{\frac{1 - x}{\sqrt{1 + x}}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\frac{1}{\sqrt{1 + x}}} \cdot \sqrt{\frac{1 - x}{\sqrt{1 + x}}}\right)
double f(double x) {
        double r11589 = 2.0;
        double r11590 = 1.0;
        double r11591 = x;
        double r11592 = r11590 - r11591;
        double r11593 = r11590 + r11591;
        double r11594 = r11592 / r11593;
        double r11595 = sqrt(r11594);
        double r11596 = atan(r11595);
        double r11597 = r11589 * r11596;
        return r11597;
}

double f(double x) {
        double r11598 = 2.0;
        double r11599 = 1.0;
        double r11600 = 1.0;
        double r11601 = x;
        double r11602 = r11600 + r11601;
        double r11603 = sqrt(r11602);
        double r11604 = r11599 / r11603;
        double r11605 = sqrt(r11604);
        double r11606 = r11600 - r11601;
        double r11607 = r11606 / r11603;
        double r11608 = sqrt(r11607);
        double r11609 = r11605 * r11608;
        double r11610 = atan(r11609);
        double r11611 = r11598 * r11610;
        return r11611;
}

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 *-un-lft-identity0.0

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

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

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

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

Reproduce

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