\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.394362921332223351644270586304115137557 \cdot 10^{-33}:\\
\;\;\;\;\frac{y}{z \cdot \frac{x}{\cosh x}}\\
\mathbf{elif}\;z \le 2.035540255879025646360089979447494101805 \cdot 10^{-6}:\\
\;\;\;\;\frac{y}{\frac{x}{\cosh x}} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{x}{\cosh x}}\\
\end{array}double f(double x, double y, double z) {
double r26042325 = x;
double r26042326 = cosh(r26042325);
double r26042327 = y;
double r26042328 = r26042327 / r26042325;
double r26042329 = r26042326 * r26042328;
double r26042330 = z;
double r26042331 = r26042329 / r26042330;
return r26042331;
}
double f(double x, double y, double z) {
double r26042332 = z;
double r26042333 = -6.394362921332223e-33;
bool r26042334 = r26042332 <= r26042333;
double r26042335 = y;
double r26042336 = x;
double r26042337 = cosh(r26042336);
double r26042338 = r26042336 / r26042337;
double r26042339 = r26042332 * r26042338;
double r26042340 = r26042335 / r26042339;
double r26042341 = 2.0355402558790256e-06;
bool r26042342 = r26042332 <= r26042341;
double r26042343 = r26042335 / r26042338;
double r26042344 = 1.0;
double r26042345 = r26042344 / r26042332;
double r26042346 = r26042343 * r26042345;
double r26042347 = r26042342 ? r26042346 : r26042340;
double r26042348 = r26042334 ? r26042340 : r26042347;
return r26042348;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -6.394362921332223e-33 or 2.0355402558790256e-06 < z Initial program 11.5
rmApplied *-un-lft-identity11.5
Applied associate-/r*11.5
Simplified11.5
rmApplied associate-/l/0.3
if -6.394362921332223e-33 < z < 2.0355402558790256e-06Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied associate-/r*0.3
Simplified0.3
rmApplied div-inv0.4
Final simplification0.4
herbie shell --seed 2019172
(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))