\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(x, 6, -9 \cdot {x}^{2}\right)double f(double x) {
double r574631 = 3.0;
double r574632 = 2.0;
double r574633 = x;
double r574634 = r574633 * r574631;
double r574635 = r574632 - r574634;
double r574636 = r574631 * r574635;
double r574637 = r574636 * r574633;
return r574637;
}
double f(double x) {
double r574638 = x;
double r574639 = 6.0;
double r574640 = 9.0;
double r574641 = 2.0;
double r574642 = pow(r574638, r574641);
double r574643 = r574640 * r574642;
double r574644 = -r574643;
double r574645 = fma(r574638, r574639, r574644);
return r574645;
}




Bits error versus x
| Original | 0.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.3
Taylor expanded around 0 0.2
Simplified0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Simplified0.2
rmApplied fma-def0.1
Final simplification0.1
herbie shell --seed 2019326 +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))