Average Error: 0.0 → 0.0
Time: 10.0s
Precision: 64
\[\left(x + y\right) \cdot \left(x - y\right)\]
\[{x}^{2} - {y}^{2}\]
\left(x + y\right) \cdot \left(x - y\right)
{x}^{2} - {y}^{2}
double f(double x, double y) {
        double r102640 = x;
        double r102641 = y;
        double r102642 = r102640 + r102641;
        double r102643 = r102640 - r102641;
        double r102644 = r102642 * r102643;
        return r102644;
}

double f(double x, double y) {
        double r102645 = x;
        double r102646 = 2.0;
        double r102647 = pow(r102645, r102646);
        double r102648 = y;
        double r102649 = pow(r102648, r102646);
        double r102650 = r102647 - r102649;
        return r102650;
}

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 0.0

    \[\left(x + y\right) \cdot \left(x - y\right)\]
  2. Using strategy rm
  3. Applied pow10.0

    \[\leadsto \left(x + y\right) \cdot \color{blue}{{\left(x - y\right)}^{1}}\]
  4. Applied pow10.0

    \[\leadsto \color{blue}{{\left(x + y\right)}^{1}} \cdot {\left(x - y\right)}^{1}\]
  5. Applied pow-prod-down0.0

    \[\leadsto \color{blue}{{\left(\left(x + y\right) \cdot \left(x - y\right)\right)}^{1}}\]
  6. Simplified0.0

    \[\leadsto {\color{blue}{\left({x}^{2} - {y}^{2}\right)}}^{1}\]
  7. Final simplification0.0

    \[\leadsto {x}^{2} - {y}^{2}\]

Reproduce

herbie shell --seed 2019323 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f1 from sbv-4.4"
  :precision binary64
  (* (+ x y) (- x y)))