x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;z \le -5.456893094179093804320322909204701959778 \cdot 10^{-222} \lor \neg \left(z \le -1.998153801628733335171500404420370674566 \cdot 10^{-247} \lor \neg \left(z \le 4.05788010217845352231803013478156312545 \cdot 10^{-197}\right) \land z \le 1.296418022463658713943633924036189200527 \cdot 10^{117}\right):\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{y}}\\
\end{array}double f(double x, double y, double z, double t) {
double r403260 = x;
double r403261 = y;
double r403262 = z;
double r403263 = r403261 / r403262;
double r403264 = t;
double r403265 = r403263 * r403264;
double r403266 = r403265 / r403264;
double r403267 = r403260 * r403266;
return r403267;
}
double f(double x, double y, double z, double __attribute__((unused)) t) {
double r403268 = z;
double r403269 = -5.456893094179094e-222;
bool r403270 = r403268 <= r403269;
double r403271 = -1.9981538016287333e-247;
bool r403272 = r403268 <= r403271;
double r403273 = 4.0578801021784535e-197;
bool r403274 = r403268 <= r403273;
double r403275 = !r403274;
double r403276 = 1.2964180224636587e+117;
bool r403277 = r403268 <= r403276;
bool r403278 = r403275 && r403277;
bool r403279 = r403272 || r403278;
double r403280 = !r403279;
bool r403281 = r403270 || r403280;
double r403282 = y;
double r403283 = x;
double r403284 = r403282 * r403283;
double r403285 = r403284 / r403268;
double r403286 = r403283 / r403268;
double r403287 = 1.0;
double r403288 = r403287 / r403282;
double r403289 = r403286 / r403288;
double r403290 = r403281 ? r403285 : r403289;
return r403290;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 15.1 |
|---|---|
| Target | 1.8 |
| Herbie | 6.1 |
if z < -5.456893094179094e-222 or -1.9981538016287333e-247 < z < 4.0578801021784535e-197 or 1.2964180224636587e+117 < z Initial program 15.2
Simplified6.7
rmApplied associate-/l*6.7
rmApplied clear-num7.1
Simplified7.1
rmApplied *-un-lft-identity7.1
Applied times-frac7.2
Applied add-cube-cbrt7.2
Applied times-frac7.1
Simplified7.1
Simplified6.7
rmApplied *-un-lft-identity6.7
Applied associate-*l*6.7
Simplified6.7
if -5.456893094179094e-222 < z < -1.9981538016287333e-247 or 4.0578801021784535e-197 < z < 1.2964180224636587e+117Initial program 15.0
Simplified5.0
rmApplied associate-/l*4.5
rmApplied div-inv4.6
Applied associate-/r*4.4
Final simplification6.1
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
:herbie-target
(if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))
(* x (/ (* (/ y z) t) t)))