\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(x, 6, x \cdot \left(-9 \cdot x\right)\right)double f(double x) {
double r625148 = 3.0;
double r625149 = 2.0;
double r625150 = x;
double r625151 = r625150 * r625148;
double r625152 = r625149 - r625151;
double r625153 = r625148 * r625152;
double r625154 = r625153 * r625150;
return r625154;
}
double f(double x) {
double r625155 = x;
double r625156 = 6.0;
double r625157 = 9.0;
double r625158 = r625157 * r625155;
double r625159 = -r625158;
double r625160 = r625155 * r625159;
double r625161 = fma(r625155, r625156, r625160);
return r625161;
}




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