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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 2.0 |
| Herbie | 1.8 |
if t < -4.7704861853011726e-138Initial program 7.3
rmApplied *-un-lft-identity_binary647.3
Applied times-frac_binary641.4
Simplified1.4
rmApplied add-cube-cbrt_binary641.8
Applied associate-*l*_binary641.8
Simplified1.8
rmApplied associate-*l/_binary642.3
if -4.7704861853011726e-138 < t < 8.0456712852415279e-300Initial program 3.5
if 8.0456712852415279e-300 < t Initial program 6.8
rmApplied *-un-lft-identity_binary646.8
Applied times-frac_binary641.9
Simplified1.9
rmApplied add-sqr-sqrt_binary642.1
Applied add-cube-cbrt_binary642.4
Applied times-frac_binary642.4
Applied associate-*r*_binary641.0
Final simplification1.8
herbie shell --seed 2021118
(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)))