Average Error: 0.1 → 0.1
Time: 4.9s
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 r89591 = 1.0;
        double r89592 = x;
        double r89593 = r89591 / r89592;
        double r89594 = r89592 * r89592;
        double r89595 = r89591 - r89594;
        double r89596 = sqrt(r89595);
        double r89597 = r89596 / r89592;
        double r89598 = r89593 + r89597;
        double r89599 = log(r89598);
        return r89599;
}

double f(double x) {
        double r89600 = 1.0;
        double r89601 = x;
        double r89602 = r89600 / r89601;
        double r89603 = r89601 * r89601;
        double r89604 = r89600 - r89603;
        double r89605 = sqrt(r89604);
        double r89606 = r89605 / r89601;
        double r89607 = r89602 + r89606;
        double r89608 = log(r89607);
        return r89608;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Final simplification0.1

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

Reproduce

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