\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -7744513270.8935337066650390625:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \frac{\frac{\sin y}{y}}{-z}\\
\end{array}double f(double x, double y, double z) {
double r681657 = x;
double r681658 = y;
double r681659 = sin(r681658);
double r681660 = r681659 / r681658;
double r681661 = r681657 * r681660;
double r681662 = z;
double r681663 = r681661 / r681662;
return r681663;
}
double f(double x, double y, double z) {
double r681664 = x;
double r681665 = -7744513270.893534;
bool r681666 = r681664 <= r681665;
double r681667 = y;
double r681668 = sin(r681667);
double r681669 = r681668 * r681664;
double r681670 = r681669 / r681667;
double r681671 = z;
double r681672 = r681670 / r681671;
double r681673 = r681668 / r681667;
double r681674 = -r681671;
double r681675 = r681673 / r681674;
double r681676 = r681664 * r681675;
double r681677 = -r681676;
double r681678 = r681666 ? r681672 : r681677;
return r681678;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if x < -7744513270.893534Initial program 0.2
rmApplied associate-*r/0.3
if -7744513270.893534 < x Initial program 3.5
Simplified1.9
rmApplied frac-2neg1.9
Simplified1.9
Final simplification1.5
herbie shell --seed 2019174
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))