Average Error: 0.4 → 0.4
Time: 12.6s
Precision: 64
\[\sqrt{x} \cdot \sqrt{x - y}\]
\[\sqrt{x} \cdot \sqrt{x - y}\]
\sqrt{x} \cdot \sqrt{x - y}
\sqrt{x} \cdot \sqrt{x - y}
double f(double x, double y) {
        double r1800499 = x;
        double r1800500 = sqrt(r1800499);
        double r1800501 = y;
        double r1800502 = r1800499 - r1800501;
        double r1800503 = sqrt(r1800502);
        double r1800504 = r1800500 * r1800503;
        return r1800504;
}

double f(double x, double y) {
        double r1800505 = x;
        double r1800506 = sqrt(r1800505);
        double r1800507 = y;
        double r1800508 = r1800505 - r1800507;
        double r1800509 = sqrt(r1800508);
        double r1800510 = r1800506 * r1800509;
        return r1800510;
}

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.4

    \[\sqrt{x} \cdot \sqrt{x - y}\]
  2. Final simplification0.4

    \[\leadsto \sqrt{x} \cdot \sqrt{x - y}\]

Reproduce

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