Average Error: 15.4 → 15.4
Time: 16.6s
Precision: 64
$\sqrt{x \cdot y - z \cdot z} - z$
$\sqrt{y \cdot x - z \cdot z} - z$
\sqrt{x \cdot y - z \cdot z} - z
\sqrt{y \cdot x - z \cdot z} - z
double f(double x, double y, double z) {
double r45060597 = x;
double r45060598 = y;
double r45060599 = r45060597 * r45060598;
double r45060600 = z;
double r45060601 = r45060600 * r45060600;
double r45060602 = r45060599 - r45060601;
double r45060603 = sqrt(r45060602);
double r45060604 = r45060603 - r45060600;
return r45060604;
}


double f(double x, double y, double z) {
double r45060605 = y;
double r45060606 = x;
double r45060607 = r45060605 * r45060606;
double r45060608 = z;
double r45060609 = r45060608 * r45060608;
double r45060610 = r45060607 - r45060609;
double r45060611 = sqrt(r45060610);
double r45060612 = r45060611 - r45060608;
return r45060612;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 15.4

$\sqrt{x \cdot y - z \cdot z} - z$
2. Final simplification15.4

$\leadsto \sqrt{y \cdot x - z \cdot z} - z$

# Reproduce

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