\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \leq -4.728082249545035 \cdot 10^{+167}:\\
\;\;\;\;x + \left(\left(1 + \frac{a}{t}\right) \cdot \frac{y \cdot z}{t} - y \cdot \left(\frac{a}{t} + \frac{a}{t} \cdot \frac{a}{t}\right)\right)\\
\mathbf{elif}\;t \leq 8.129618047138009 \cdot 10^{+176}:\\
\;\;\;\;x + \left(y + y \cdot \left(\frac{t}{a - t} - \frac{z}{a - t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\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 (<= t -4.728082249545035e+167)
(+
x
(-
(* (+ 1.0 (/ a t)) (/ (* y z) t))
(* y (+ (/ a t) (* (/ a t) (/ a t))))))
(if (<= t 8.129618047138009e+176)
(+ x (+ y (* y (- (/ t (- a t)) (/ z (- a t))))))
(+ x (/ y (/ t (- z a)))))))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 (t <= -4.728082249545035e+167) {
tmp = x + (((1.0 + (a / t)) * ((y * z) / t)) - (y * ((a / t) + ((a / t) * (a / t)))));
} else if (t <= 8.129618047138009e+176) {
tmp = x + (y + (y * ((t / (a - t)) - (z / (a - t)))));
} else {
tmp = x + (y / (t / (z - a)));
}
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.3 |
|---|---|
| Target | 8.1 |
| Herbie | 6.5 |
if t < -4.7280822495450354e167Initial program 30.9
rmApplied associate--l+_binary64_1331426.4
Simplified11.2
Taylor expanded around inf 23.8
Simplified11.0
if -4.7280822495450354e167 < t < 8.12961804713800851e176Initial program 11.3
Taylor expanded around 0 8.5
Simplified5.9
if 8.12961804713800851e176 < t Initial program 34.4
rmApplied associate--l+_binary64_1331429.9
Simplified14.0
Taylor expanded around inf 14.1
Simplified5.6
Final simplification6.5
herbie shell --seed 2021090
(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))))