Average Error: 0.1 → 0.1
Time: 11.8s
Precision: 64
$0.0 \le u \le 1$
$\frac{-\left(u \cdot u\right) \cdot u}{6}$
$\frac{u}{6} \cdot \left(-u \cdot u\right)$
\frac{-\left(u \cdot u\right) \cdot u}{6}
\frac{u}{6} \cdot \left(-u \cdot u\right)
double f(double u) {
double r5841699 = u;
double r5841700 = r5841699 * r5841699;
double r5841701 = r5841700 * r5841699;
double r5841702 = -r5841701;
double r5841703 = 6.0;
double r5841704 = r5841702 / r5841703;
return r5841704;
}


double f(double u) {
double r5841705 = u;
double r5841706 = 6.0;
double r5841707 = r5841705 / r5841706;
double r5841708 = r5841705 * r5841705;
double r5841709 = -r5841708;
double r5841710 = r5841707 * r5841709;
return r5841710;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.1

$\frac{-\left(u \cdot u\right) \cdot u}{6}$
2. Using strategy rm
3. Applied *-un-lft-identity0.1

$\leadsto \frac{-\left(u \cdot u\right) \cdot u}{\color{blue}{1 \cdot 6}}$
4. Applied distribute-lft-neg-in0.1

$\leadsto \frac{\color{blue}{\left(-u \cdot u\right) \cdot u}}{1 \cdot 6}$
5. Applied times-frac0.1

$\leadsto \color{blue}{\frac{-u \cdot u}{1} \cdot \frac{u}{6}}$
6. Simplified0.1

$\leadsto \color{blue}{\left(-u \cdot u\right)} \cdot \frac{u}{6}$
7. Final simplification0.1

$\leadsto \frac{u}{6} \cdot \left(-u \cdot u\right)$

# Reproduce

herbie shell --seed 1
(FPCore (u)
:name "bspline3"
:pre (<= 0.0 u 1.0)
(/ (- (* (* u u) u)) 6.0))