x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\
\;\;\;\;x + \frac{1}{\frac{a - t}{y}} \cdot \frac{1}{\frac{1}{z - t}}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 1.0296131601567404 \cdot 10^{+212}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\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 (<= (/ (* y (- z t)) (- a t)) (- INFINITY))
(+ x (* (/ 1.0 (/ (- a t) y)) (/ 1.0 (/ 1.0 (- z t)))))
(if (<= (/ (* y (- z t)) (- a t)) 1.0296131601567404e+212)
(+ (/ (* y (- z t)) (- a t)) x)
(+ x (/ y (/ (- a t) (- z t)))))))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 (((y * (z - t)) / (a - t)) <= -((double) INFINITY)) {
tmp = x + ((1.0 / ((a - t) / y)) * (1.0 / (1.0 / (z - t))));
} else if (((y * (z - t)) / (a - t)) <= 1.0296131601567404e+212) {
tmp = ((y * (z - t)) / (a - t)) + x;
} else {
tmp = x + (y / ((a - t) / (z - t)));
}
return tmp;
}




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.4 |
| Herbie | 0.4 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 64.0
rmApplied add-cube-cbrt_binary6464.0
Applied associate-/r*_binary6464.0
Simplified19.3
rmApplied clear-num_binary6419.4
Simplified0.3
rmApplied div-inv_binary640.3
Applied *-un-lft-identity_binary640.3
Applied times-frac_binary640.3
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 1.02961316015674038e212Initial program 0.2
rmApplied *-un-lft-identity_binary640.2
Applied times-frac_binary641.5
Simplified1.5
Taylor expanded around 0 0.2
if 1.02961316015674038e212 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 49.3
rmApplied associate-/l*_binary641.8
Final simplification0.4
herbie shell --seed 2021118
(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))))