\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 r567569 = 3.0;
double r567570 = 2.0;
double r567571 = x;
double r567572 = r567571 * r567569;
double r567573 = r567570 - r567572;
double r567574 = r567569 * r567573;
double r567575 = r567574 * r567571;
return r567575;
}
double f(double x) {
double r567576 = x;
double r567577 = 6.0;
double r567578 = 9.0;
double r567579 = 2.0;
double r567580 = pow(r567576, r567579);
double r567581 = r567578 * r567580;
double r567582 = -r567581;
double r567583 = fma(r567576, r567577, r567582);
return r567583;
}




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
rmApplied fma-def0.1
Final simplification0.1
herbie shell --seed 2019323 +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))