x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;a \leq -6.129063740118231 \cdot 10^{-63}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{elif}\;a \leq 7.682638558877552 \cdot 10^{-286}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.129063740118231e-63)
(+ x (/ y (/ (- a t) (- z t))))
(if (<= a 7.682638558877552e-286)
(+ x (* (- z t) (/ y (- a t))))
(fma y (/ (- z t) (- a t)) x))))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 tmp;
if (a <= -6.129063740118231e-63) {
tmp = x + (y / ((a - t) / (z - t)));
} else if (a <= 7.682638558877552e-286) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = fma(y, ((z - t) / (a - t)), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.9 |
|---|---|
| Target | 1.2 |
| Herbie | 1.7 |
if a < -6.12906374011823067e-63Initial program 11.8
Applied associate-/l*_binary640.4
if -6.12906374011823067e-63 < a < 7.6826385588775523e-286Initial program 9.7
Simplified3.0
Taylor expanded in y around 0 9.7
Simplified4.4
if 7.6826385588775523e-286 < a Initial program 10.7
Simplified1.3
Final simplification1.7
herbie shell --seed 2021280
(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))))