Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{\sqrt{1 - x \cdot x}}}{\frac{x}{\sqrt{\sqrt{1 - x \cdot x}}}}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{\sqrt{1 - x \cdot x}}}{\frac{x}{\sqrt{\sqrt{1 - x \cdot x}}}}\right)
double f(double x) {
        double r76016 = 1.0;
        double r76017 = x;
        double r76018 = r76016 / r76017;
        double r76019 = r76017 * r76017;
        double r76020 = r76016 - r76019;
        double r76021 = sqrt(r76020);
        double r76022 = r76021 / r76017;
        double r76023 = r76018 + r76022;
        double r76024 = log(r76023);
        return r76024;
}

double f(double x) {
        double r76025 = 1.0;
        double r76026 = x;
        double r76027 = r76025 / r76026;
        double r76028 = r76026 * r76026;
        double r76029 = r76025 - r76028;
        double r76030 = sqrt(r76029);
        double r76031 = sqrt(r76030);
        double r76032 = r76026 / r76031;
        double r76033 = r76031 / r76032;
        double r76034 = r76027 + r76033;
        double r76035 = log(r76034);
        return r76035;
}

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

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\sqrt{\color{blue}{\sqrt{1 - x \cdot x} \cdot \sqrt{1 - x \cdot x}}}}{x}\right)\]
  4. Applied sqrt-prod0.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\color{blue}{\sqrt{\sqrt{1 - x \cdot x}} \cdot \sqrt{\sqrt{1 - x \cdot x}}}}{x}\right)\]
  5. Applied associate-/l*0.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\frac{\sqrt{\sqrt{1 - x \cdot x}}}{\frac{x}{\sqrt{\sqrt{1 - x \cdot x}}}}}\right)\]
  6. Final simplification0.0

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

Reproduce

herbie shell --seed 2020036 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))