Average Error: 0.0 → 0.0
Time: 14.3s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{\sqrt{\sqrt{1 - x} \cdot \sqrt{x + 1}} \cdot \sqrt{\sqrt{1 - x} \cdot \sqrt{x + 1}}}{x} + \frac{1}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{\sqrt{\sqrt{1 - x} \cdot \sqrt{x + 1}} \cdot \sqrt{\sqrt{1 - x} \cdot \sqrt{x + 1}}}{x} + \frac{1}{x}\right)
double f(double x) {
        double r1104663 = 1.0;
        double r1104664 = x;
        double r1104665 = r1104663 / r1104664;
        double r1104666 = r1104664 * r1104664;
        double r1104667 = r1104663 - r1104666;
        double r1104668 = sqrt(r1104667);
        double r1104669 = r1104668 / r1104664;
        double r1104670 = r1104665 + r1104669;
        double r1104671 = log(r1104670);
        return r1104671;
}

double f(double x) {
        double r1104672 = 1.0;
        double r1104673 = x;
        double r1104674 = r1104672 - r1104673;
        double r1104675 = sqrt(r1104674);
        double r1104676 = r1104673 + r1104672;
        double r1104677 = sqrt(r1104676);
        double r1104678 = r1104675 * r1104677;
        double r1104679 = sqrt(r1104678);
        double r1104680 = r1104679 * r1104679;
        double r1104681 = r1104680 / r1104673;
        double r1104682 = r1104672 / r1104673;
        double r1104683 = r1104681 + r1104682;
        double r1104684 = log(r1104683);
        return r1104684;
}

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 *-un-lft-identity0.0

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

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

    \[\leadsto \log \left(\frac{1}{x} + \frac{\color{blue}{\sqrt{1 + x} \cdot \sqrt{1 - x}}}{x}\right)\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.0

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

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

Reproduce

herbie shell --seed 2019129 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))