\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -4.1179437477253498797497071716188107059 \cdot 10^{-81} \lor \neg \left(x \le 5.715011145653865345597923439061032092042 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r543190 = x;
double r543191 = y;
double r543192 = sin(r543191);
double r543193 = r543192 / r543191;
double r543194 = r543190 * r543193;
double r543195 = z;
double r543196 = r543194 / r543195;
return r543196;
}
double f(double x, double y, double z) {
double r543197 = x;
double r543198 = -4.11794374772535e-81;
bool r543199 = r543197 <= r543198;
double r543200 = 5.715011145653865e-24;
bool r543201 = r543197 <= r543200;
double r543202 = !r543201;
bool r543203 = r543199 || r543202;
double r543204 = y;
double r543205 = sin(r543204);
double r543206 = 1.0;
double r543207 = r543206 / r543204;
double r543208 = r543205 * r543207;
double r543209 = r543197 * r543208;
double r543210 = z;
double r543211 = r543209 / r543210;
double r543212 = r543210 / r543197;
double r543213 = r543205 / r543204;
double r543214 = r543212 / r543213;
double r543215 = r543206 / r543214;
double r543216 = r543203 ? r543211 : r543215;
return r543216;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if x < -4.11794374772535e-81 or 5.715011145653865e-24 < x Initial program 0.5
rmApplied div-inv0.6
if -4.11794374772535e-81 < x < 5.715011145653865e-24Initial program 5.3
rmApplied div-inv5.4
rmApplied clear-num5.9
Simplified0.9
Final simplification0.7
herbie shell --seed 2020002 +o rules:numerics
(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))