\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(6, x, -9 \cdot {x}^{2}\right)double f(double x) {
double r447784 = 3.0;
double r447785 = 2.0;
double r447786 = x;
double r447787 = r447786 * r447784;
double r447788 = r447785 - r447787;
double r447789 = r447784 * r447788;
double r447790 = r447789 * r447786;
return r447790;
}
double f(double x) {
double r447791 = 6.0;
double r447792 = x;
double r447793 = 9.0;
double r447794 = 2.0;
double r447795 = pow(r447792, r447794);
double r447796 = r447793 * r447795;
double r447797 = -r447796;
double r447798 = fma(r447791, r447792, r447797);
return r447798;
}




Bits error versus x
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.2
Taylor expanded around 0 0.2
Simplified0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Simplified0.2
Simplified0.2
rmApplied fma-def0.1
Final simplification0.1
herbie shell --seed 2020043 +o rules:numerics
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"
:precision binary64
:herbie-target
(- (* 6 x) (* 9 (* x x)))
(* (* 3 (- 2 (* x 3))) x))