\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 9.374996475980067 \cdot 10^{-85}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{y}}{\frac{1}{\sin y}} \cdot x}{z}\\
\end{array}double f(double x, double y, double z) {
double r22135060 = x;
double r22135061 = y;
double r22135062 = sin(r22135061);
double r22135063 = r22135062 / r22135061;
double r22135064 = r22135060 * r22135063;
double r22135065 = z;
double r22135066 = r22135064 / r22135065;
return r22135066;
}
double f(double x, double y, double z) {
double r22135067 = x;
double r22135068 = 9.374996475980067e-85;
bool r22135069 = r22135067 <= r22135068;
double r22135070 = z;
double r22135071 = y;
double r22135072 = sin(r22135071);
double r22135073 = r22135071 / r22135072;
double r22135074 = r22135070 * r22135073;
double r22135075 = r22135067 / r22135074;
double r22135076 = 1.0;
double r22135077 = r22135076 / r22135071;
double r22135078 = r22135076 / r22135072;
double r22135079 = r22135077 / r22135078;
double r22135080 = r22135079 * r22135067;
double r22135081 = r22135080 / r22135070;
double r22135082 = r22135069 ? r22135075 : r22135081;
return r22135082;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.3 |
| Herbie | 1.6 |
if x < 9.374996475980067e-85Initial program 4.0
rmApplied clear-num4.0
rmApplied associate-/l*2.1
Simplified2.1
if 9.374996475980067e-85 < x Initial program 0.5
rmApplied clear-num0.5
rmApplied div-inv0.6
Applied associate-/r*0.6
Final simplification1.6
herbie shell --seed 2019168
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))