Average Error: 0.0 → 0.0
Time: 5.3s
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 r3159212 = 1.0;
        double r3159213 = x;
        double r3159214 = r3159212 / r3159213;
        double r3159215 = r3159213 * r3159213;
        double r3159216 = r3159212 - r3159215;
        double r3159217 = sqrt(r3159216);
        double r3159218 = r3159217 / r3159213;
        double r3159219 = r3159214 + r3159218;
        double r3159220 = log(r3159219);
        return r3159220;
}

double f(double x) {
        double r3159221 = 1.0;
        double r3159222 = x;
        double r3159223 = r3159221 / r3159222;
        double r3159224 = r3159222 * r3159222;
        double r3159225 = r3159221 - r3159224;
        double r3159226 = sqrt(r3159225);
        double r3159227 = r3159226 / r3159222;
        double r3159228 = r3159223 + r3159227;
        double r3159229 = log(r3159228);
        return r3159229;
}

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 2019172 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))