Average Error: 0.0 → 0.0
Time: 5.8s
Precision: 64
\[\sqrt{1 - x \cdot x}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)\]
\sqrt{1 - x \cdot x}
\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)
double f(double x) {
        double r107611 = 1.0;
        double r107612 = x;
        double r107613 = r107612 * r107612;
        double r107614 = r107611 - r107613;
        double r107615 = sqrt(r107614);
        return r107615;
}

double f(double x) {
        double r107616 = 1.0;
        double r107617 = x;
        double r107618 = r107617 * r107617;
        double r107619 = r107616 - r107618;
        double r107620 = sqrt(r107619);
        double r107621 = expm1(r107620);
        double r107622 = log1p(r107621);
        return r107622;
}

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

    \[\sqrt{1 - x \cdot x}\]
  2. Using strategy rm
  3. Applied log1p-expm1-u0.0

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)}\]
  4. Final simplification0.0

    \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)\]

Reproduce

herbie shell --seed 2019304 +o rules:numerics
(FPCore (x)
  :name "Diagrams.TwoD.Ellipse:ellipse from diagrams-lib-1.3.0.3"
  :precision binary64
  (sqrt (- 1 (* x x))))