\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 1.5167308587843438 \cdot 10^{54}:\\
\;\;\;\;x \cdot \left(\frac{\sin y}{y} \cdot \frac{1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r527953 = x;
double r527954 = y;
double r527955 = sin(r527954);
double r527956 = r527955 / r527954;
double r527957 = r527953 * r527956;
double r527958 = z;
double r527959 = r527957 / r527958;
return r527959;
}
double f(double x, double y, double z) {
double r527960 = x;
double r527961 = 1.5167308587843438e+54;
bool r527962 = r527960 <= r527961;
double r527963 = y;
double r527964 = sin(r527963);
double r527965 = r527964 / r527963;
double r527966 = 1.0;
double r527967 = z;
double r527968 = r527966 / r527967;
double r527969 = r527965 * r527968;
double r527970 = r527960 * r527969;
double r527971 = r527960 * r527964;
double r527972 = r527966 / r527963;
double r527973 = r527971 * r527972;
double r527974 = r527973 / r527967;
double r527975 = r527962 ? r527970 : r527974;
return r527975;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.5 |
|---|---|
| Target | 0.3 |
| Herbie | 1.7 |
if x < 1.5167308587843438e+54Initial program 3.0
rmApplied div-inv3.1
rmApplied associate-*l*2.0
if 1.5167308587843438e+54 < x Initial program 0.2
rmApplied div-inv0.3
Applied associate-*r*0.4
Final simplification1.7
herbie shell --seed 2020039
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
: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))