\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.5463407620259075 \cdot 10^{83} \lor \neg \left(z \le 1.00828897081930849 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{\sqrt{1}}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r2652 = x;
double r2653 = y;
double r2654 = sin(r2653);
double r2655 = r2654 / r2653;
double r2656 = r2652 * r2655;
double r2657 = z;
double r2658 = r2656 / r2657;
return r2658;
}
double f(double x, double y, double z) {
double r2659 = z;
double r2660 = -8.546340762025908e+83;
bool r2661 = r2659 <= r2660;
double r2662 = 1.0082889708193085e-64;
bool r2663 = r2659 <= r2662;
double r2664 = !r2663;
bool r2665 = r2661 || r2664;
double r2666 = x;
double r2667 = r2666 / r2659;
double r2668 = 1.0;
double r2669 = sqrt(r2668);
double r2670 = y;
double r2671 = sin(r2670);
double r2672 = r2671 / r2670;
double r2673 = r2669 / r2672;
double r2674 = r2667 / r2673;
double r2675 = r2659 / r2672;
double r2676 = r2666 / r2675;
double r2677 = r2665 ? r2674 : r2676;
return r2677;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
if z < -8.546340762025908e+83 or 1.0082889708193085e-64 < z Initial program 0.2
rmApplied clear-num0.9
rmApplied div-inv1.0
Applied associate-/r*0.4
rmApplied add-sqr-sqrt0.4
Applied times-frac0.5
Applied associate-/r*0.5
Simplified0.3
if -8.546340762025908e+83 < z < 1.0082889708193085e-64Initial program 5.4
rmApplied clear-num5.6
rmApplied div-inv6.1
Applied associate-/r*6.0
rmApplied *-un-lft-identity6.0
Applied *-un-lft-identity6.0
Applied times-frac6.0
Applied associate-/l*6.2
Simplified5.6
rmApplied *-un-lft-identity5.6
Applied times-frac1.0
Applied associate-/r*0.6
Simplified0.5
Final simplification0.4
herbie shell --seed 2020025
(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))