x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -\infty:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\
\mathbf{elif}\;\frac{y}{z} \le -2.260559411855018598510891206887091885181 \cdot 10^{-253}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;\frac{y}{z} \le 3.757059281014894097749857788400547545613 \cdot 10^{-220}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;\frac{y}{z} \le 1.409130514825537046443418609777720419861 \cdot 10^{217}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r539204 = x;
double r539205 = y;
double r539206 = z;
double r539207 = r539205 / r539206;
double r539208 = t;
double r539209 = r539207 * r539208;
double r539210 = r539209 / r539208;
double r539211 = r539204 * r539210;
return r539211;
}
double f(double x, double y, double z, double __attribute__((unused)) t) {
double r539212 = y;
double r539213 = z;
double r539214 = r539212 / r539213;
double r539215 = -inf.0;
bool r539216 = r539214 <= r539215;
double r539217 = x;
double r539218 = r539217 * r539212;
double r539219 = 1.0;
double r539220 = r539219 / r539213;
double r539221 = r539218 * r539220;
double r539222 = -2.2605594118550186e-253;
bool r539223 = r539214 <= r539222;
double r539224 = r539214 * r539217;
double r539225 = 3.757059281014894e-220;
bool r539226 = r539214 <= r539225;
double r539227 = r539218 / r539213;
double r539228 = 1.409130514825537e+217;
bool r539229 = r539214 <= r539228;
double r539230 = r539217 / r539213;
double r539231 = r539212 * r539230;
double r539232 = r539229 ? r539224 : r539231;
double r539233 = r539226 ? r539227 : r539232;
double r539234 = r539223 ? r539224 : r539233;
double r539235 = r539216 ? r539221 : r539234;
return r539235;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.7 |
|---|---|
| Target | 1.6 |
| Herbie | 0.3 |
if (/ y z) < -inf.0Initial program 64.0
Simplified0.3
rmApplied div-inv0.3
if -inf.0 < (/ y z) < -2.2605594118550186e-253 or 3.757059281014894e-220 < (/ y z) < 1.409130514825537e+217Initial program 9.5
Simplified8.5
rmApplied *-un-lft-identity8.5
Applied times-frac0.2
Simplified0.2
if -2.2605594118550186e-253 < (/ y z) < 3.757059281014894e-220Initial program 18.7
Simplified0.4
rmApplied div-inv0.4
rmApplied associate-*r/0.4
Simplified0.4
if 1.409130514825537e+217 < (/ y z) Initial program 44.0
Simplified1.0
rmApplied div-inv1.1
Taylor expanded around 0 1.0
Simplified0.4
Final simplification0.3
herbie shell --seed 2019194 +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)))