x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \le 5.085802590344858309312584733803549621767 \cdot 10^{-285} \lor \neg \left(x \le 5.248255780313278222557610834682352778851 \cdot 10^{-105}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r231617 = x;
double r231618 = y;
double r231619 = z;
double r231620 = r231619 - r231617;
double r231621 = r231618 * r231620;
double r231622 = t;
double r231623 = r231621 / r231622;
double r231624 = r231617 + r231623;
return r231624;
}
double f(double x, double y, double z, double t) {
double r231625 = x;
double r231626 = 5.085802590344858e-285;
bool r231627 = r231625 <= r231626;
double r231628 = 5.248255780313278e-105;
bool r231629 = r231625 <= r231628;
double r231630 = !r231629;
bool r231631 = r231627 || r231630;
double r231632 = y;
double r231633 = t;
double r231634 = r231632 / r231633;
double r231635 = z;
double r231636 = r231635 - r231625;
double r231637 = fma(r231634, r231636, r231625);
double r231638 = r231632 * r231636;
double r231639 = r231638 / r231633;
double r231640 = r231639 + r231625;
double r231641 = r231631 ? r231637 : r231640;
return r231641;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.0 |
|---|---|
| Target | 1.8 |
| Herbie | 1.8 |
if x < 5.085802590344858e-285 or 5.248255780313278e-105 < x Initial program 6.3
Simplified1.3
if 5.085802590344858e-285 < x < 5.248255780313278e-105Initial program 4.5
Simplified4.3
rmApplied fma-udef4.3
Simplified4.7
rmApplied div-inv4.7
rmApplied add-cube-cbrt5.3
Applied associate-*l*5.3
Simplified4.2
rmApplied associate-*r/5.2
Simplified4.5
Final simplification1.8
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))