Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[4 \cdot s - r \cdot r\]
\[s \cdot 4 - r \cdot r\]
4 \cdot s - r \cdot r
s \cdot 4 - r \cdot r
double f(double s, double r) {
        double r16947459 = 4.0;
        double r16947460 = s;
        double r16947461 = r16947459 * r16947460;
        double r16947462 = r;
        double r16947463 = r16947462 * r16947462;
        double r16947464 = r16947461 - r16947463;
        return r16947464;
}

double f(double s, double r) {
        double r16947465 = s;
        double r16947466 = 4.0;
        double r16947467 = r16947465 * r16947466;
        double r16947468 = r;
        double r16947469 = r16947468 * r16947468;
        double r16947470 = r16947467 - r16947469;
        return r16947470;
}

Error

Bits error versus s

Bits error versus r

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[4 \cdot s - r \cdot r\]
  2. Final simplification0.0

    \[\leadsto s \cdot 4 - r \cdot r\]

Reproduce

herbie shell --seed 1 
(FPCore (s r)
  :name "4 * s - r * r"
  (- (* 4 s) (* r r)))