Average Error: 32.0 → 32.0
Time: 1.2s
Precision: binary64
\[\frac{0.75 \cdot {\left(2 \cdot R - h\right)}^{2}}{3 \cdot R - h}\]
\[\frac{0.75 \cdot {\left(2 \cdot R - h\right)}^{2}}{3 \cdot R - h}\]
\frac{0.75 \cdot {\left(2 \cdot R - h\right)}^{2}}{3 \cdot R - h}
\frac{0.75 \cdot {\left(2 \cdot R - h\right)}^{2}}{3 \cdot R - h}
double code(double R, double h) {
	return ((double) (((double) (0.75 * ((double) pow(((double) (((double) (2.0 * R)) - h)), 2.0)))) / ((double) (((double) (3.0 * R)) - h))));
}
double code(double R, double h) {
	return ((double) (((double) (0.75 * ((double) pow(((double) (((double) (2.0 * R)) - h)), 2.0)))) / ((double) (((double) (3.0 * R)) - h))));
}

Error

Bits error versus R

Bits error versus h

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.0

    \[\frac{0.75 \cdot {\left(2 \cdot R - h\right)}^{2}}{3 \cdot R - h}\]
  2. Final simplification32.0

    \[\leadsto \frac{0.75 \cdot {\left(2 \cdot R - h\right)}^{2}}{3 \cdot R - h}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (R h)
  :name "(/ (* 0.75 (pow (- (* 2 R) h) 2)) (- (* 3 R) h))"
  :precision binary64
  (/ (* 0.75 (pow (- (* 2.0 R) h) 2.0)) (- (* 3.0 R) h)))