\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\begin{array}{l}
\mathbf{if}\;y \leq -1.0098576522032265 \cdot 10^{-302}:\\
\;\;\;\;3 \cdot \left(y \cdot {x}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot \sqrt{y \cdot 3}\right)}^{2}\\
\end{array}
(FPCore (x y) :precision binary64 (* (* (* x 3.0) x) y))
(FPCore (x y) :precision binary64 (if (<= y -1.0098576522032265e-302) (* 3.0 (* y (pow x 2.0))) (pow (* x (sqrt (* y 3.0))) 2.0)))
double code(double x, double y) {
return ((x * 3.0) * x) * y;
}
double code(double x, double y) {
double tmp;
if (y <= -1.0098576522032265e-302) {
tmp = 3.0 * (y * pow(x, 2.0));
} else {
tmp = pow((x * sqrt((y * 3.0))), 2.0);
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.2 |
|---|---|
| Target | 0.2 |
| Herbie | 5.5 |
if y < -1.00985765220322646e-302Initial program 9.8
Taylor expanded in x around 0 9.8
if -1.00985765220322646e-302 < y Initial program 10.5
Taylor expanded in x around 0 10.5
Applied egg-rr1.3
Final simplification5.5
herbie shell --seed 2022125
(FPCore (x y)
:name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* (* x 3.0) (* x y))
(* (* (* x 3.0) x) y))