Average Error: 0.0 → 0.0
Time: 8.2s
Precision: 64
\[\sqrt{1 - x \cdot x}\]
\[\log \left(\sqrt{e^{\sqrt{1 - x \cdot x}}}\right) + \log \left(\sqrt{e^{\sqrt{1 - x \cdot x}}}\right)\]
\sqrt{1 - x \cdot x}
\log \left(\sqrt{e^{\sqrt{1 - x \cdot x}}}\right) + \log \left(\sqrt{e^{\sqrt{1 - x \cdot x}}}\right)
double f(double x) {
        double r10221493 = 1.0;
        double r10221494 = x;
        double r10221495 = r10221494 * r10221494;
        double r10221496 = r10221493 - r10221495;
        double r10221497 = sqrt(r10221496);
        return r10221497;
}

double f(double x) {
        double r10221498 = 1.0;
        double r10221499 = x;
        double r10221500 = r10221499 * r10221499;
        double r10221501 = r10221498 - r10221500;
        double r10221502 = sqrt(r10221501);
        double r10221503 = exp(r10221502);
        double r10221504 = sqrt(r10221503);
        double r10221505 = log(r10221504);
        double r10221506 = r10221505 + r10221505;
        return r10221506;
}

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 add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\sqrt{1 - x \cdot x}}\right)}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.0

    \[\leadsto \log \color{blue}{\left(\sqrt{e^{\sqrt{1 - x \cdot x}}} \cdot \sqrt{e^{\sqrt{1 - x \cdot x}}}\right)}\]
  6. Applied log-prod0.0

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

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

Reproduce

herbie shell --seed 2019169 
(FPCore (x)
  :name "Diagrams.TwoD.Ellipse:ellipse from diagrams-lib-1.3.0.3"
  (sqrt (- 1.0 (* x x))))