\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -9.3033804533966324 \cdot 10^{-7}:\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{elif}\;x \le 4.0553809354711968 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r669183 = x;
double r669184 = y;
double r669185 = sin(r669184);
double r669186 = r669185 / r669184;
double r669187 = r669183 * r669186;
double r669188 = z;
double r669189 = r669187 / r669188;
return r669189;
}
double f(double x, double y, double z) {
double r669190 = x;
double r669191 = -9.303380453396632e-07;
bool r669192 = r669190 <= r669191;
double r669193 = y;
double r669194 = sin(r669193);
double r669195 = r669194 / r669193;
double r669196 = r669190 * r669195;
double r669197 = z;
double r669198 = r669196 / r669197;
double r669199 = 4.055380935471197e-43;
bool r669200 = r669190 <= r669199;
double r669201 = r669190 / r669197;
double r669202 = r669193 / r669194;
double r669203 = r669201 / r669202;
double r669204 = r669190 * r669194;
double r669205 = r669204 / r669193;
double r669206 = r669205 / r669197;
double r669207 = r669200 ? r669203 : r669206;
double r669208 = r669192 ? r669198 : r669207;
return r669208;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -9.303380453396632e-07Initial program 0.2
if -9.303380453396632e-07 < x < 4.055380935471197e-43Initial program 5.0
rmApplied div-inv5.1
rmApplied associate-/l*0.2
Simplified0.1
rmApplied associate-/r*0.1
if 4.055380935471197e-43 < x Initial program 0.3
rmApplied div-inv0.4
rmApplied *-un-lft-identity0.4
Applied associate-*l*0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2020047
(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))