\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -21934061023014455604714685600852303140620000:\\
\;\;\;\;\frac{1}{z} \cdot \left(\frac{\sin y}{y} \cdot x\right)\\
\mathbf{elif}\;x \le 3.8662219941802638253842348368985834299 \cdot 10^{104}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sin y \cdot x\right) \cdot \frac{1}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r24080456 = x;
double r24080457 = y;
double r24080458 = sin(r24080457);
double r24080459 = r24080458 / r24080457;
double r24080460 = r24080456 * r24080459;
double r24080461 = z;
double r24080462 = r24080460 / r24080461;
return r24080462;
}
double f(double x, double y, double z) {
double r24080463 = x;
double r24080464 = -2.1934061023014456e+43;
bool r24080465 = r24080463 <= r24080464;
double r24080466 = 1.0;
double r24080467 = z;
double r24080468 = r24080466 / r24080467;
double r24080469 = y;
double r24080470 = sin(r24080469);
double r24080471 = r24080470 / r24080469;
double r24080472 = r24080471 * r24080463;
double r24080473 = r24080468 * r24080472;
double r24080474 = 3.866221994180264e+104;
bool r24080475 = r24080463 <= r24080474;
double r24080476 = r24080467 / r24080471;
double r24080477 = r24080463 / r24080476;
double r24080478 = r24080470 * r24080463;
double r24080479 = r24080466 / r24080469;
double r24080480 = r24080478 * r24080479;
double r24080481 = r24080480 / r24080467;
double r24080482 = r24080475 ? r24080477 : r24080481;
double r24080483 = r24080465 ? r24080473 : r24080482;
return r24080483;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
if x < -2.1934061023014456e+43Initial program 0.2
rmApplied div-inv0.4
if -2.1934061023014456e+43 < x < 3.866221994180264e+104Initial program 3.8
rmApplied associate-/l*0.5
if 3.866221994180264e+104 < x Initial program 0.2
rmApplied div-inv0.3
Applied associate-*r*0.4
Final simplification0.4
herbie shell --seed 2019171
(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))