\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1689746151164735731134924526336755105792 \lor \neg \left(x \le 3.65008048955020314402416831939325420996 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\sin y}{y}\\
\end{array}double f(double x, double y, double z) {
double r504002 = x;
double r504003 = y;
double r504004 = sin(r504003);
double r504005 = r504004 / r504003;
double r504006 = r504002 * r504005;
double r504007 = z;
double r504008 = r504006 / r504007;
return r504008;
}
double f(double x, double y, double z) {
double r504009 = x;
double r504010 = -1.6897461511647357e+39;
bool r504011 = r504009 <= r504010;
double r504012 = 3.650080489550203e-75;
bool r504013 = r504009 <= r504012;
double r504014 = !r504013;
bool r504015 = r504011 || r504014;
double r504016 = y;
double r504017 = sin(r504016);
double r504018 = 1.0;
double r504019 = r504018 / r504016;
double r504020 = r504017 * r504019;
double r504021 = r504009 * r504020;
double r504022 = z;
double r504023 = r504021 / r504022;
double r504024 = r504009 / r504022;
double r504025 = r504017 / r504016;
double r504026 = r504024 * r504025;
double r504027 = r504015 ? r504023 : r504026;
return r504027;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -1.6897461511647357e+39 or 3.650080489550203e-75 < x Initial program 0.4
rmApplied div-inv0.5
if -1.6897461511647357e+39 < x < 3.650080489550203e-75Initial program 4.8
rmApplied associate-/l*0.2
rmApplied associate-/r/0.2
Final simplification0.3
herbie shell --seed 2019356
(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))