\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;z \leq -2.504837340528092 \cdot 10^{-188}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\\
\mathbf{elif}\;z \leq 4.771245480372301 \cdot 10^{-73}:\\
\;\;\;\;x + \left(y - \frac{y \cdot \left(z - t\right)}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\
\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 (<= z -2.504837340528092e-188)
(-
(+ x y)
(* (/ (- z t) (* (cbrt (- a t)) (cbrt (- a t)))) (/ y (cbrt (- a t)))))
(if (<= z 4.771245480372301e-73)
(+ x (- y (/ (* y (- z t)) (- a t))))
(- (+ x y) (/ (- z t) (/ (- a t) y))))))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 (z <= -2.504837340528092e-188) {
tmp = (x + y) - (((z - t) / (cbrt(a - t) * cbrt(a - t))) * (y / cbrt(a - t)));
} else if (z <= 4.771245480372301e-73) {
tmp = x + (y - ((y * (z - t)) / (a - t)));
} else {
tmp = (x + y) - ((z - t) / ((a - t) / y));
}
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.7 |
|---|---|
| Target | 8.6 |
| Herbie | 11.2 |
if z < -2.50483734052809196e-188Initial program 16.4
rmApplied add-cube-cbrt_binary6416.6
Applied times-frac_binary6410.6
if -2.50483734052809196e-188 < z < 4.7712454803723e-73Initial program 17.4
rmApplied associate--l+_binary6413.7
if 4.7712454803723e-73 < z Initial program 16.3
rmApplied associate-/l*_binary649.4
Final simplification11.2
herbie shell --seed 2020219
(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))))