Average Error: 0.0 → 0.0
Time: 4.2s
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 r42012 = 1.0;
        double r42013 = x;
        double r42014 = r42012 / r42013;
        double r42015 = r42013 * r42013;
        double r42016 = r42012 - r42015;
        double r42017 = sqrt(r42016);
        double r42018 = r42017 / r42013;
        double r42019 = r42014 + r42018;
        double r42020 = log(r42019);
        return r42020;
}

double f(double x) {
        double r42021 = 1.0;
        double r42022 = x;
        double r42023 = r42021 / r42022;
        double r42024 = r42022 * r42022;
        double r42025 = r42021 - r42024;
        double r42026 = sqrt(r42025);
        double r42027 = r42026 / r42022;
        double r42028 = r42023 + r42027;
        double r42029 = log(r42028);
        return r42029;
}

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