Average Error: 33.3 → 30.0
Time: 2.8s
Precision: binary64
\[\left(\left(\left(\left(\left(2 \cdot f\right) \cdot d\right) \cdot 2\right) \cdot f\right) \cdot d - \left(\left(\left(4 \cdot d\right) \cdot d\right) \cdot f\right) \cdot f\right) - {r}^{2}\]
\[\left(\left(d \cdot d\right) \cdot \left(f \cdot f\right)\right) \cdot \left(2 \cdot 2 - 4\right) - {r}^{2}\]
\left(\left(\left(\left(\left(2 \cdot f\right) \cdot d\right) \cdot 2\right) \cdot f\right) \cdot d - \left(\left(\left(4 \cdot d\right) \cdot d\right) \cdot f\right) \cdot f\right) - {r}^{2}
\left(\left(d \cdot d\right) \cdot \left(f \cdot f\right)\right) \cdot \left(2 \cdot 2 - 4\right) - {r}^{2}
double code(double f, double d, double r) {
	return ((double) (((double) (((double) (((double) (((double) (((double) (((double) (2.0 * f)) * d)) * 2.0)) * f)) * d)) - ((double) (((double) (((double) (((double) (4.0 * d)) * d)) * f)) * f)))) - ((double) pow(r, 2.0))));
}
double code(double f, double d, double r) {
	return ((double) (((double) (((double) (((double) (d * d)) * ((double) (f * f)))) * ((double) (((double) (2.0 * 2.0)) - 4.0)))) - ((double) pow(r, 2.0))));
}

Error

Bits error versus f

Bits error versus d

Bits error versus r

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 33.3

    \[\left(\left(\left(\left(\left(2 \cdot f\right) \cdot d\right) \cdot 2\right) \cdot f\right) \cdot d - \left(\left(\left(4 \cdot d\right) \cdot d\right) \cdot f\right) \cdot f\right) - {r}^{2}\]
  2. Simplified30.0

    \[\leadsto \color{blue}{\left(\left(d \cdot d\right) \cdot \left(f \cdot f\right)\right) \cdot \left(2 \cdot 2 - 4\right) - {r}^{2}}\]
  3. Final simplification30.0

    \[\leadsto \left(\left(d \cdot d\right) \cdot \left(f \cdot f\right)\right) \cdot \left(2 \cdot 2 - 4\right) - {r}^{2}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (f d r)
  :name "(- (- (* (* (* (* (* 2 f) d) 2) f) d) (* (* (* (* 4 d) d) f) f)) (pow r 2))"
  :precision binary64
  (- (- (* (* (* (* (* 2.0 f) d) 2.0) f) d) (* (* (* (* 4.0 d) d) f) f)) (pow r 2.0)))