\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -4.4697002957629188 \cdot 10^{211}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\mathbf{elif}\;t \le -4.604891947633429 \cdot 10^{-207}:\\
\;\;\;\;y \cdot \frac{t - z}{a - t} + \left(x + y\right)\\
\mathbf{elif}\;t \le 6.953532797602288 \cdot 10^{-132}:\\
\;\;\;\;\left(y \cdot \left(t - z\right)\right) \cdot \frac{1}{a - t} + \left(x + y\right)\\
\mathbf{elif}\;t \le 5.0511599837810109 \cdot 10^{195}:\\
\;\;\;\;y \cdot \frac{t - z}{a - t} + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\end{array}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 temp;
if ((t <= -4.469700295762919e+211)) {
temp = fma((z / t), y, x);
} else {
double temp_1;
if ((t <= -4.6048919476334295e-207)) {
temp_1 = ((y * ((t - z) / (a - t))) + (x + y));
} else {
double temp_2;
if ((t <= 6.953532797602288e-132)) {
temp_2 = (((y * (t - z)) * (1.0 / (a - t))) + (x + y));
} else {
double temp_3;
if ((t <= 5.051159983781011e+195)) {
temp_3 = ((y * ((t - z) / (a - t))) + (x + y));
} else {
temp_3 = fma((z / t), y, x);
}
temp_2 = temp_3;
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.0 |
|---|---|
| Target | 8.3 |
| Herbie | 8.7 |
if t < -4.469700295762919e+211 or 5.051159983781011e+195 < t Initial program 33.9
Simplified25.5
rmApplied fma-udef25.6
rmApplied div-inv25.6
Applied associate-*l*24.3
Simplified24.4
Taylor expanded around inf 15.5
Simplified9.7
if -4.469700295762919e+211 < t < -4.6048919476334295e-207 or 6.953532797602288e-132 < t < 5.051159983781011e+195Initial program 14.4
Simplified10.3
rmApplied fma-udef10.3
rmApplied div-inv10.3
Applied associate-*l*9.7
Simplified9.7
if -4.6048919476334295e-207 < t < 6.953532797602288e-132Initial program 4.7
Simplified3.9
rmApplied fma-udef3.9
rmApplied div-inv3.9
Applied associate-*l*4.8
Simplified4.7
rmApplied div-inv4.8
Applied associate-*r*4.7
Final simplification8.7
herbie shell --seed 2020049 +o rules:numerics
(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 (- 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 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))