\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 r873768 = 3.0;
double r873769 = 2.0;
double r873770 = x;
double r873771 = r873770 * r873768;
double r873772 = r873769 - r873771;
double r873773 = r873768 * r873772;
double r873774 = r873773 * r873770;
return r873774;
}
double f(double x) {
double r873775 = 6.0;
double r873776 = x;
double r873777 = 9.0;
double r873778 = 2.0;
double r873779 = pow(r873776, r873778);
double r873780 = r873777 * r873779;
double r873781 = -r873780;
double r873782 = fma(r873775, r873776, r873781);
return r873782;
}




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 2020042 +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))