\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \leq -1.5964659875812437 \cdot 10^{-80}:\\
\;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\
\mathbf{elif}\;z \leq 3.0222555522334117 \cdot 10^{-175}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
:precision binary64
(if (<= z -1.5964659875812437e-80)
(* x (- (/ y (- t z)) (/ z (- t z))))
(if (<= z 3.0222555522334117e-175)
(* (- y z) (/ x (- t z)))
(/ x (/ (- t z) (- y z))))))double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5964659875812437e-80) {
tmp = x * ((y / (t - z)) - (z / (t - z)));
} else if (z <= 3.0222555522334117e-175) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x / ((t - z) / (y - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 12.0 |
|---|---|
| Target | 2.2 |
| Herbie | 2.3 |
if z < -1.59646598758124371e-80Initial program 15.0
Applied *-un-lft-identity_binary6415.0
Applied times-frac_binary640.4
Simplified0.4
Taylor expanded in y around 0 0.4
if -1.59646598758124371e-80 < z < 3.0222555522334117e-175Initial program 6.3
Applied associate-/l*_binary645.6
Taylor expanded in t around 0 5.6
Applied div-inv_binary645.6
Applied div-inv_binary645.6
Applied distribute-rgt-out--_binary645.6
Applied *-un-lft-identity_binary645.6
Applied times-frac_binary645.8
Simplified5.7
if 3.0222555522334117e-175 < z Initial program 13.2
Applied associate-/l*_binary641.6
Applied *-un-lft-identity_binary641.6
Applied associate-/r*_binary641.6
Final simplification2.3
herbie shell --seed 2022081
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))