Average Error: 0.0 → 0.0
Time: 10.7s
Precision: 64
\[\sqrt{1 - x \cdot x}\]
\[\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(1 - x \cdot x\right)\right)}\]
\sqrt{1 - x \cdot x}
\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(1 - x \cdot x\right)\right)}
double f(double x) {
        double r13197371 = 1.0;
        double r13197372 = x;
        double r13197373 = r13197372 * r13197372;
        double r13197374 = r13197371 - r13197373;
        double r13197375 = sqrt(r13197374);
        return r13197375;
}

double f(double x) {
        double r13197376 = 1.0;
        double r13197377 = x;
        double r13197378 = r13197377 * r13197377;
        double r13197379 = r13197376 - r13197378;
        double r13197380 = log1p(r13197379);
        double r13197381 = expm1(r13197380);
        double r13197382 = sqrt(r13197381);
        return r13197382;
}

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 expm1-log1p-u0.0

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

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

Reproduce

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