Average Error: 9.6 → 0.1
Time: 12.5s
Precision: 64
\[1 - \left(x \cdot x\right) \cdot \left(1 - y \cdot y\right)\]
\[1 - \left(x \cdot \left(x \cdot \left(\sqrt{1} + y\right)\right)\right) \cdot \left(\sqrt{1} - y\right)\]
1 - \left(x \cdot x\right) \cdot \left(1 - y \cdot y\right)
1 - \left(x \cdot \left(x \cdot \left(\sqrt{1} + y\right)\right)\right) \cdot \left(\sqrt{1} - y\right)
double f(double x, double y) {
        double r38905 = 1.0;
        double r38906 = x;
        double r38907 = r38906 * r38906;
        double r38908 = y;
        double r38909 = r38908 * r38908;
        double r38910 = r38905 - r38909;
        double r38911 = r38907 * r38910;
        double r38912 = r38905 - r38911;
        return r38912;
}

double f(double x, double y) {
        double r38913 = 1.0;
        double r38914 = x;
        double r38915 = sqrt(r38913);
        double r38916 = y;
        double r38917 = r38915 + r38916;
        double r38918 = r38914 * r38917;
        double r38919 = r38914 * r38918;
        double r38920 = r38915 - r38916;
        double r38921 = r38919 * r38920;
        double r38922 = r38913 - r38921;
        return r38922;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 9.6

    \[1 - \left(x \cdot x\right) \cdot \left(1 - y \cdot y\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt9.6

    \[\leadsto 1 - \left(x \cdot x\right) \cdot \left(\color{blue}{\sqrt{1} \cdot \sqrt{1}} - y \cdot y\right)\]
  4. Applied difference-of-squares9.6

    \[\leadsto 1 - \left(x \cdot x\right) \cdot \color{blue}{\left(\left(\sqrt{1} + y\right) \cdot \left(\sqrt{1} - y\right)\right)}\]
  5. Applied associate-*r*2.9

    \[\leadsto 1 - \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\sqrt{1} + y\right)\right) \cdot \left(\sqrt{1} - y\right)}\]
  6. Using strategy rm
  7. Applied associate-*l*0.1

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

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

Reproduce

herbie shell --seed 1 
(FPCore (x y)
  :name "1 - (x* x) * (1 - y* y)"
  :precision binary64
  (- 1 (* (* x x) (- 1 (* y y)))))