\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -0.001616770998561857129380281428154830791755 \lor \neg \left(y \le 7.142361989502533093026412822345017131219 \cdot 10^{-24}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \cosh x}{z}\\
\end{array}double f(double x, double y, double z) {
double r337346 = x;
double r337347 = cosh(r337346);
double r337348 = y;
double r337349 = r337348 / r337346;
double r337350 = r337347 * r337349;
double r337351 = z;
double r337352 = r337350 / r337351;
return r337352;
}
double f(double x, double y, double z) {
double r337353 = y;
double r337354 = -0.0016167709985618571;
bool r337355 = r337353 <= r337354;
double r337356 = 7.142361989502533e-24;
bool r337357 = r337353 <= r337356;
double r337358 = !r337357;
bool r337359 = r337355 || r337358;
double r337360 = x;
double r337361 = cosh(r337360);
double r337362 = z;
double r337363 = r337362 * r337360;
double r337364 = r337353 / r337363;
double r337365 = r337361 * r337364;
double r337366 = r337353 / r337360;
double r337367 = r337366 * r337361;
double r337368 = r337367 / r337362;
double r337369 = r337359 ? r337365 : r337368;
return r337369;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if y < -0.0016167709985618571 or 7.142361989502533e-24 < y Initial program 19.9
Simplified0.4
if -0.0016167709985618571 < y < 7.142361989502533e-24Initial program 0.3
Final simplification0.3
herbie shell --seed 2019196
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))