x + \frac{\left(y - z\right) \cdot t}{a - z}\begin{array}{l}
\mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} \le -1.61575697840551178 \cdot 10^{250} \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 7.9291238590814451 \cdot 10^{55}\right):\\
\;\;\;\;y \cdot \frac{t}{a - z} + \mathsf{fma}\left(-z, \frac{t}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{\left(y - z\right) \cdot t}{a - z} + x\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - z) * t) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if ((((((y - z) * t) / (a - z)) <= -1.6157569784055118e+250) || !((((y - z) * t) / (a - z)) <= 7.929123859081445e+55))) {
temp = ((y * (t / (a - z))) + fma(-z, (t / (a - z)), x));
} else {
temp = ((1.0 * (((y - z) * t) / (a - z))) + x);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.3 |
|---|---|
| Target | 0.5 |
| Herbie | 1.1 |
if (/ (* (- y z) t) (- a z)) < -1.6157569784055118e+250 or 7.929123859081445e+55 < (/ (* (- y z) t) (- a z)) Initial program 35.5
Simplified2.6
rmApplied clear-num2.6
rmApplied fma-udef2.6
Simplified3.2
rmApplied sub-neg3.2
Applied distribute-rgt-in3.2
Applied associate-+l+3.2
Simplified3.2
if -1.6157569784055118e+250 < (/ (* (- y z) t) (- a z)) < 7.929123859081445e+55Initial program 0.3
Simplified1.0
rmApplied clear-num1.0
rmApplied fma-udef1.0
Simplified3.1
rmApplied *-un-lft-identity3.1
Applied associate-*l*3.1
Simplified0.3
Final simplification1.1
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, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))