\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq -1.0111297021358746 \cdot 10^{+253} \lor \neg \left(\frac{\cosh x \cdot \frac{y}{x}}{z} \leq 5.972197416252351 \cdot 10^{+190}\right):\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
(FPCore (x y z)
:precision binary64
(if (or (<= (/ (* (cosh x) (/ y x)) z) -1.0111297021358746e+253)
(not (<= (/ (* (cosh x) (/ y x)) z) 5.972197416252351e+190)))
(/ (* (cosh x) (/ y z)) x)
(/ (* (cosh x) (/ y x)) z)))double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
double code(double x, double y, double z) {
double tmp;
if ((((cosh(x) * (y / x)) / z) <= -1.0111297021358746e+253) || !(((cosh(x) * (y / x)) / z) <= 5.972197416252351e+190)) {
tmp = (cosh(x) * (y / z)) / x;
} else {
tmp = (cosh(x) * (y / x)) / z;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < -1.01112970213587456e253 or 5.97219741625235093e190 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 32.4
rmApplied associate-*r/_binary6432.4
Applied associate-/l/_binary6412.5
Simplified12.5
rmApplied times-frac_binary640.5
rmApplied associate-*l/_binary640.4
if -1.01112970213587456e253 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 5.97219741625235093e190Initial program 0.2
Final simplification0.3
herbie shell --seed 2020233
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.0385305359351529e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))