Average Error: 0.0 → 0.0
Time: 33.8s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x \cdot \left(x \cdot x\right)}}{\sqrt{1 + \left(x \cdot x + x\right)} \cdot \sqrt{1 + x}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x \cdot \left(x \cdot x\right)}}{\sqrt{1 + \left(x \cdot x + x\right)} \cdot \sqrt{1 + x}}\right)
double f(double x) {
        double r1081504 = 2.0;
        double r1081505 = 1.0;
        double r1081506 = x;
        double r1081507 = r1081505 - r1081506;
        double r1081508 = r1081505 + r1081506;
        double r1081509 = r1081507 / r1081508;
        double r1081510 = sqrt(r1081509);
        double r1081511 = atan(r1081510);
        double r1081512 = r1081504 * r1081511;
        return r1081512;
}

double f(double x) {
        double r1081513 = 2.0;
        double r1081514 = 1.0;
        double r1081515 = x;
        double r1081516 = r1081515 * r1081515;
        double r1081517 = r1081515 * r1081516;
        double r1081518 = r1081514 - r1081517;
        double r1081519 = sqrt(r1081518);
        double r1081520 = r1081516 + r1081515;
        double r1081521 = r1081514 + r1081520;
        double r1081522 = sqrt(r1081521);
        double r1081523 = r1081514 + r1081515;
        double r1081524 = sqrt(r1081523);
        double r1081525 = r1081522 * r1081524;
        double r1081526 = r1081519 / r1081525;
        double r1081527 = atan(r1081526);
        double r1081528 = r1081513 * r1081527;
        return r1081528;
}

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 sqrt-div0.0

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

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

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

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

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

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

Reproduce

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