\frac{x \cdot \left(y - z\right)}{y}
\begin{array}{l}
\mathbf{if}\;x \leq -1.569308653238193 \cdot 10^{-19}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;x \leq -4.706085207486899 \cdot 10^{-289}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (<= x -1.569308653238193e-19)
(* x (/ (- y z) y))
(if (<= x -4.706085207486899e-289)
(- x (/ (* x z) y))
(/ x (/ y (- y z))))))double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
double code(double x, double y, double z) {
double tmp;
if (x <= -1.569308653238193e-19) {
tmp = x * ((y - z) / y);
} else if (x <= -4.706085207486899e-289) {
tmp = x - ((x * z) / y);
} else {
tmp = x / (y / (y - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 3.1 |
| Herbie | 2.2 |
if x < -1.56930865323819311e-19Initial program 21.3
Applied *-un-lft-identity_binary6421.3
Applied times-frac_binary640.1
Simplified0.1
if -1.56930865323819311e-19 < x < -4.70608520748689864e-289Initial program 4.3
Taylor expanded in y around 0 2.1
if -4.70608520748689864e-289 < x Initial program 12.4
Applied associate-/l*_binary643.3
Final simplification2.2
herbie shell --seed 2022020
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))