\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 r20939020 = x;
double r20939021 = y;
double r20939022 = sin(r20939021);
double r20939023 = r20939022 / r20939021;
double r20939024 = r20939020 * r20939023;
double r20939025 = z;
double r20939026 = r20939024 / r20939025;
return r20939026;
}
double f(double x, double y, double z) {
double r20939027 = x;
double r20939028 = -8.230194912459417e+102;
bool r20939029 = r20939027 <= r20939028;
double r20939030 = 1.0;
double r20939031 = y;
double r20939032 = r20939030 / r20939031;
double r20939033 = sin(r20939031);
double r20939034 = r20939033 * r20939027;
double r20939035 = r20939032 * r20939034;
double r20939036 = z;
double r20939037 = r20939035 / r20939036;
double r20939038 = 5.118933034108623e-123;
bool r20939039 = r20939027 <= r20939038;
double r20939040 = r20939033 / r20939031;
double r20939041 = r20939040 / r20939036;
double r20939042 = r20939027 * r20939041;
double r20939043 = r20939039 ? r20939042 : r20939037;
double r20939044 = r20939029 ? r20939037 : r20939043;
return r20939044;
}




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 +o rules:numerics
(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))