Average Error: 0.0 → 0.0
Time: 4.0s
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 r15793 = 2.0;
        double r15794 = 1.0;
        double r15795 = x;
        double r15796 = r15794 - r15795;
        double r15797 = r15794 + r15795;
        double r15798 = r15796 / r15797;
        double r15799 = sqrt(r15798);
        double r15800 = atan(r15799);
        double r15801 = r15793 * r15800;
        return r15801;
}

double f(double x) {
        double r15802 = 2.0;
        double r15803 = 1.0;
        double r15804 = 1.0;
        double r15805 = x;
        double r15806 = r15804 + r15805;
        double r15807 = sqrt(r15806);
        double r15808 = r15803 / r15807;
        double r15809 = sqrt(r15808);
        double r15810 = r15804 - r15805;
        double r15811 = r15810 / r15807;
        double r15812 = sqrt(r15811);
        double r15813 = r15809 * r15812;
        double r15814 = atan(r15813);
        double r15815 = r15802 * r15814;
        return r15815;
}

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 2020062 +o rules:numerics
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))