Average Error: 26.2 → 26.2
Time: 1.4s
Precision: binary64
\[\frac{a \cdot c + b \cdot d}{{c}^{2} + {d}^{2}}\]
\[\frac{a \cdot c + b \cdot d}{{c}^{2} + {d}^{2}}\]
\frac{a \cdot c + b \cdot d}{{c}^{2} + {d}^{2}}
\frac{a \cdot c + b \cdot d}{{c}^{2} + {d}^{2}}
double code(double a, double c, double b, double d) {
	return ((double) (((double) (((double) (a * c)) + ((double) (b * d)))) / ((double) (((double) pow(c, 2.0)) + ((double) pow(d, 2.0))))));
}
double code(double a, double c, double b, double d) {
	return ((double) (((double) (((double) (a * c)) + ((double) (b * d)))) / ((double) (((double) pow(c, 2.0)) + ((double) pow(d, 2.0))))));
}

Error

Bits error versus a

Bits error versus c

Bits error versus b

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 26.2

    \[\frac{a \cdot c + b \cdot d}{{c}^{2} + {d}^{2}}\]
  2. Final simplification26.2

    \[\leadsto \frac{a \cdot c + b \cdot d}{{c}^{2} + {d}^{2}}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (a c b d)
  :name "(/ (+ (* a c) (* b d)) (+ (pow c 2) (pow d 2)))"
  :precision binary64
  (/ (+ (* a c) (* b d)) (+ (pow c 2.0) (pow d 2.0))))