x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -1.0071455594193599 \cdot 10^{-271} \lor \neg \left(t \le 8.49657610056407139 \cdot 10^{-71}\right):\\
\;\;\;\;y \cdot \left(\frac{z}{a - t} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t}{a - t}\right)\right)\right) + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + ((y * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if (((t <= -1.0071455594193599e-271) || !(t <= 8.496576100564071e-71))) {
temp = ((y * ((z / (a - t)) - log1p(expm1((t / (a - t)))))) + x);
} else {
temp = (((y * (z - t)) / (a - t)) + 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.9 |
|---|---|
| Target | 1.3 |
| Herbie | 1.5 |
if t < -1.0071455594193599e-271 or 8.496576100564071e-71 < t Initial program 12.7
Simplified2.9
rmApplied fma-udef2.9
rmApplied div-inv2.9
Applied associate-*l*0.9
Simplified0.9
rmApplied div-sub0.8
rmApplied log1p-expm1-u0.9
if -1.0071455594193599e-271 < t < 8.496576100564071e-71Initial program 3.8
Simplified3.5
rmApplied fma-udef3.5
rmApplied div-inv3.5
Applied associate-*l*3.5
Simplified3.5
rmApplied associate-*r/3.8
Final simplification1.5
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))