x + \frac{\left(y - x\right) \cdot z}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot z}{t} \leq -3.359553345002256 \cdot 10^{+288}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;x + \frac{\left(y - x\right) \cdot z}{t} \leq -1.0555988803179481 \cdot 10^{-200}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y - x\right) \cdot \left(\sqrt[3]{z} \cdot \left(\sqrt[3]{z} \cdot \frac{\sqrt[3]{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right)\right)\right) \cdot \frac{\sqrt[3]{\sqrt[3]{z}}}{\sqrt[3]{t}}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
(FPCore (x y z t)
:precision binary64
(if (<= (+ x (/ (* (- y x) z) t)) -3.359553345002256e+288)
(+ x (* (- y x) (/ z t)))
(if (<= (+ x (/ (* (- y x) z) t)) -1.0555988803179481e-200)
(+ x (/ (* (- y x) z) t))
(+
x
(*
(*
(- y x)
(*
(cbrt z)
(* (cbrt z) (/ (cbrt (* (cbrt z) (cbrt z))) (* (cbrt t) (cbrt t))))))
(/ (cbrt (cbrt z)) (cbrt t)))))))double code(double x, double y, double z, double t) {
return ((double) (x + (((double) (((double) (y - x)) * z)) / t)));
}
double code(double x, double y, double z, double t) {
double tmp;
if ((((double) (x + (((double) (((double) (y - x)) * z)) / t))) <= -3.359553345002256e+288)) {
tmp = ((double) (x + ((double) (((double) (y - x)) * (z / t)))));
} else {
double tmp_1;
if ((((double) (x + (((double) (((double) (y - x)) * z)) / t))) <= -1.0555988803179481e-200)) {
tmp_1 = ((double) (x + (((double) (((double) (y - x)) * z)) / t)));
} else {
tmp_1 = ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (((double) cbrt(z)) * ((double) (((double) cbrt(z)) * (((double) cbrt(((double) (((double) cbrt(z)) * ((double) cbrt(z)))))) / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))))))))) * (((double) cbrt(((double) cbrt(z)))) / ((double) cbrt(t)))))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.1 |
| Herbie | 1.3 |
if (+ x (/ (* (- y x) z) t)) < -3.35955334500225614e288Initial program Error: 44.9 bits
SimplifiedError: 1.9 bits
if -3.35955334500225614e288 < (+ x (/ (* (- y x) z) t)) < -1.0555988803179481e-200Initial program Error: 0.4 bits
if -1.0555988803179481e-200 < (+ x (/ (* (- y x) z) t)) Initial program Error: 6.7 bits
SimplifiedError: 2.3 bits
rmApplied *-un-lft-identityError: 2.3 bits
Applied add-cube-cbrtError: 2.8 bits
Applied times-fracError: 2.8 bits
Applied associate-*r*Error: 4.5 bits
SimplifiedError: 4.5 bits
rmApplied add-cube-cbrtError: 4.6 bits
Applied add-cube-cbrtError: 4.6 bits
Applied cbrt-prodError: 4.6 bits
Applied times-fracError: 4.6 bits
Applied associate-*r*Error: 4.4 bits
SimplifiedError: 1.9 bits
Final simplificationError: 1.3 bits
herbie shell --seed 2020204
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))