\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \leq -1.438849187731562 \cdot 10^{-163} \lor \neg \left(a \leq 6.542204967337177 \cdot 10^{-115}\right):\\
\;\;\;\;x + \left(y - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \left(\frac{y}{\sqrt[3]{a - t}} \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -1.438849187731562e-163) (not (<= a 6.542204967337177e-115)))
(+
x
(-
y
(*
(/ (* (cbrt (- z t)) (cbrt (- z t))) (cbrt (- a t)))
(* (/ y (cbrt (- a t))) (/ (cbrt (- z t)) (cbrt (- a t)))))))
(+ x (/ (* y z) t))))double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.438849187731562e-163) || !(a <= 6.542204967337177e-115)) {
tmp = x + (y - (((cbrt(z - t) * cbrt(z - t)) / cbrt(a - t)) * ((y / cbrt(a - t)) * (cbrt(z - t) / cbrt(a - t)))));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.4 |
|---|---|
| Target | 8.5 |
| Herbie | 7.6 |
if a < -1.43884918773156206e-163 or 6.5422049673371766e-115 < a Initial program 15.0
rmApplied add-cube-cbrt_binary6415.1
Applied times-frac_binary649.0
rmApplied add-cube-cbrt_binary649.0
Applied associate-*r*_binary649.0
rmApplied associate--l+_binary648.7
Simplified8.5
rmApplied add-cube-cbrt_binary646.8
Applied times-frac_binary646.8
Applied associate-*l*_binary646.5
Simplified6.5
if -1.43884918773156206e-163 < a < 6.5422049673371766e-115Initial program 20.6
Taylor expanded around inf 10.7
Simplified10.7
Final simplification7.6
herbie shell --seed 2020231
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))