Average Error: 32.9 → 0
Time: 11.1s
Precision: 64
$\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}$
$0 \cdot d - {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}
0 \cdot d - {r}^{2}
double f(double f, double d, double r) {
double r2214188 = 2.0;
double r2214189 = f;
double r2214190 = r2214188 * r2214189;
double r2214191 = d;
double r2214192 = r2214190 * r2214191;
double r2214193 = r2214192 * r2214188;
double r2214194 = r2214193 * r2214189;
double r2214195 = r2214194 * r2214191;
double r2214196 = 4.0;
double r2214197 = r2214196 * r2214191;
double r2214198 = r2214197 * r2214191;
double r2214199 = r2214198 * r2214189;
double r2214200 = r2214199 * r2214189;
double r2214201 = r2214195 - r2214200;
double r2214202 = r;
double r2214203 = pow(r2214202, r2214188);
double r2214204 = r2214201 - r2214203;
return r2214204;
}


double f(double __attribute__((unused)) f, double d, double r) {
double r2214205 = 0.0;
double r2214206 = d;
double r2214207 = r2214205 * r2214206;
double r2214208 = r;
double r2214209 = 2.0;
double r2214210 = pow(r2214208, r2214209);
double r2214211 = r2214207 - r2214210;
return r2214211;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 32.9

$\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. Simplified16.1

$\leadsto \color{blue}{\left(\left(\left(d \cdot f\right) \cdot f\right) \cdot \left(2 \cdot 2 - 4\right)\right) \cdot d - {r}^{2}}$
3. Taylor expanded around 0 0

$\leadsto \color{blue}{0} \cdot d - {r}^{2}$
4. Final simplification0

$\leadsto 0 \cdot d - {r}^{2}$

# Reproduce

herbie shell --seed 1
(FPCore (f d r)
:name "2 * f*d * 2 * f*d - 4 * d*d * f*f - pow(r, 2)"
:precision binary64
(- (- (* (* (* (* (* 2 f) d) 2) f) d) (* (* (* (* 4 d) d) f) f)) (pow r 2)))