\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \le -1.85718037152604949 \cdot 10^{-125}:\\
\;\;\;\;\left(x - y \cdot \frac{1}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{elif}\;t \le 6.76851578320920031 \cdot 10^{-15}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{3 \cdot \frac{y \cdot z}{t}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x - (y / ((double) (z * 3.0))))) + (t / ((double) (((double) (z * 3.0)) * y)))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((t <= -1.8571803715260495e-125)) {
VAR = ((double) (((double) (x - ((double) (y * (1.0 / ((double) (z * 3.0))))))) + (t / ((double) (y * ((double) (z * 3.0)))))));
} else {
double VAR_1;
if ((t <= 6.7685157832092e-15)) {
VAR_1 = ((double) (((double) (x - (y / ((double) (z * 3.0))))) + ((double) ((1.0 / ((double) (z * 3.0))) * (t / y)))));
} else {
VAR_1 = ((double) (((double) (x - (y / ((double) (z * 3.0))))) + (1.0 / ((double) (3.0 * (((double) (y * z)) / t))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.5 |
|---|---|
| Target | 2.0 |
| Herbie | 0.6 |
if t < -1.85718037152604949e-125Initial program 1.3
rmApplied div-inv1.3
if -1.85718037152604949e-125 < t < 6.76851578320920031e-15Initial program 6.6
rmApplied *-un-lft-identity6.6
Applied times-frac0.2
if 6.76851578320920031e-15 < t Initial program 0.5
rmApplied clear-num0.6
Simplified0.5
Final simplification0.6
herbie shell --seed 2020182
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))