Average Error: 0.0 → 0.0
Time: 1.7s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
double f(double x) {
        double r43008 = 1.0;
        double r43009 = x;
        double r43010 = r43008 / r43009;
        double r43011 = r43009 * r43009;
        double r43012 = r43008 - r43011;
        double r43013 = sqrt(r43012);
        double r43014 = r43013 / r43009;
        double r43015 = r43010 + r43014;
        double r43016 = log(r43015);
        return r43016;
}

double f(double x) {
        double r43017 = 1.0;
        double r43018 = x;
        double r43019 = r43017 / r43018;
        double r43020 = r43018 * r43018;
        double r43021 = r43017 - r43020;
        double r43022 = sqrt(r43021);
        double r43023 = r43022 / r43018;
        double r43024 = r43019 + r43023;
        double r43025 = log(r43024);
        return r43025;
}

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. Final simplification0.0

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

Reproduce

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