Average Error: 16.0 → 16.0
Time: 24.7s
Precision: 64
\[\frac{\sqrt{n \cdot s2 - s1 \cdot s1}}{n}\]
\[\frac{\sqrt{s2 \cdot n - s1 \cdot s1}}{n}\]
\frac{\sqrt{n \cdot s2 - s1 \cdot s1}}{n}
\frac{\sqrt{s2 \cdot n - s1 \cdot s1}}{n}
double f(double n, double s2, double s1) {
        double r45999703 = n;
        double r45999704 = s2;
        double r45999705 = r45999703 * r45999704;
        double r45999706 = s1;
        double r45999707 = r45999706 * r45999706;
        double r45999708 = r45999705 - r45999707;
        double r45999709 = sqrt(r45999708);
        double r45999710 = r45999709 / r45999703;
        return r45999710;
}

double f(double n, double s2, double s1) {
        double r45999711 = s2;
        double r45999712 = n;
        double r45999713 = r45999711 * r45999712;
        double r45999714 = s1;
        double r45999715 = r45999714 * r45999714;
        double r45999716 = r45999713 - r45999715;
        double r45999717 = sqrt(r45999716);
        double r45999718 = r45999717 / r45999712;
        return r45999718;
}

Error

Bits error versus n

Bits error versus s2

Bits error versus s1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 16.0

    \[\frac{\sqrt{n \cdot s2 - s1 \cdot s1}}{n}\]
  2. Final simplification16.0

    \[\leadsto \frac{\sqrt{s2 \cdot n - s1 \cdot s1}}{n}\]

Reproduce

herbie shell --seed 1 
(FPCore (n s2 s1)
  :name "sqrt(n*s2-s1*s1)/n"
  (/ (sqrt (- (* n s2) (* s1 s1))) n))