\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.558037767913342817643933364747126420158 \cdot 10^{92} \lor \neg \left(z \le 5.039220706859192027751049543236769960828 \cdot 10^{68}\right):\\
\;\;\;\;\frac{x}{\frac{y}{\sin y}} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r333216 = x;
double r333217 = y;
double r333218 = sin(r333217);
double r333219 = r333218 / r333217;
double r333220 = r333216 * r333219;
double r333221 = z;
double r333222 = r333220 / r333221;
return r333222;
}
double f(double x, double y, double z) {
double r333223 = z;
double r333224 = -1.5580377679133428e+92;
bool r333225 = r333223 <= r333224;
double r333226 = 5.039220706859192e+68;
bool r333227 = r333223 <= r333226;
double r333228 = !r333227;
bool r333229 = r333225 || r333228;
double r333230 = x;
double r333231 = y;
double r333232 = sin(r333231);
double r333233 = r333231 / r333232;
double r333234 = r333230 / r333233;
double r333235 = 1.0;
double r333236 = r333235 / r333223;
double r333237 = r333234 * r333236;
double r333238 = r333232 / r333231;
double r333239 = r333223 / r333238;
double r333240 = r333230 / r333239;
double r333241 = r333229 ? r333237 : r333240;
return r333241;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if z < -1.5580377679133428e+92 or 5.039220706859192e+68 < z Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied times-frac6.0
Simplified6.0
rmApplied clear-num6.0
rmApplied div-inv6.0
Applied associate-*r*0.2
Simplified0.2
if -1.5580377679133428e+92 < z < 5.039220706859192e+68Initial program 4.5
rmApplied associate-/l*0.6
Final simplification0.5
herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))