\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -8.230194912459417 \cdot 10^{+102}:\\
\;\;\;\;\frac{\frac{1}{y} \cdot \left(\sin y \cdot x\right)}{z}\\
\mathbf{elif}\;x \le 5.118933034108623 \cdot 10^{-123}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y} \cdot \left(\sin y \cdot x\right)}{z}\\
\end{array}double f(double x, double y, double z) {
double r23884947 = x;
double r23884948 = y;
double r23884949 = sin(r23884948);
double r23884950 = r23884949 / r23884948;
double r23884951 = r23884947 * r23884950;
double r23884952 = z;
double r23884953 = r23884951 / r23884952;
return r23884953;
}
double f(double x, double y, double z) {
double r23884954 = x;
double r23884955 = -8.230194912459417e+102;
bool r23884956 = r23884954 <= r23884955;
double r23884957 = 1.0;
double r23884958 = y;
double r23884959 = r23884957 / r23884958;
double r23884960 = sin(r23884958);
double r23884961 = r23884960 * r23884954;
double r23884962 = r23884959 * r23884961;
double r23884963 = z;
double r23884964 = r23884962 / r23884963;
double r23884965 = 5.118933034108623e-123;
bool r23884966 = r23884954 <= r23884965;
double r23884967 = r23884960 / r23884958;
double r23884968 = r23884967 / r23884963;
double r23884969 = r23884954 * r23884968;
double r23884970 = r23884966 ? r23884969 : r23884964;
double r23884971 = r23884956 ? r23884964 : r23884970;
return r23884971;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.4 |
|---|---|
| Target | 0.3 |
| Herbie | 1.1 |
if x < -8.230194912459417e+102 or 5.118933034108623e-123 < x Initial program 0.7
rmApplied div-inv0.8
Applied associate-*r*1.7
if -8.230194912459417e+102 < x < 5.118933034108623e-123Initial program 3.9
rmApplied *-un-lft-identity3.9
Applied times-frac0.6
Simplified0.6
Final simplification1.1
herbie shell --seed 2019162
(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))