\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 1.5167308587843438 \cdot 10^{54}:\\
\;\;\;\;x \cdot \left(\frac{\sin y}{y} \cdot \frac{1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r428390 = x;
double r428391 = y;
double r428392 = sin(r428391);
double r428393 = r428392 / r428391;
double r428394 = r428390 * r428393;
double r428395 = z;
double r428396 = r428394 / r428395;
return r428396;
}
double f(double x, double y, double z) {
double r428397 = x;
double r428398 = 1.5167308587843438e+54;
bool r428399 = r428397 <= r428398;
double r428400 = y;
double r428401 = sin(r428400);
double r428402 = r428401 / r428400;
double r428403 = 1.0;
double r428404 = z;
double r428405 = r428403 / r428404;
double r428406 = r428402 * r428405;
double r428407 = r428397 * r428406;
double r428408 = r428397 * r428401;
double r428409 = r428403 / r428400;
double r428410 = r428408 * r428409;
double r428411 = r428410 / r428404;
double r428412 = r428399 ? r428407 : r428411;
return r428412;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.5 |
|---|---|
| Target | 0.3 |
| Herbie | 1.7 |
if x < 1.5167308587843438e+54Initial program 3.0
rmApplied div-inv3.1
rmApplied associate-*l*2.0
if 1.5167308587843438e+54 < x Initial program 0.2
rmApplied div-inv0.3
Applied associate-*r*0.4
Final simplification1.7
herbie shell --seed 2020039 +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))