\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;t \leq -8.62393080127238 \cdot 10^{-60}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{elif}\;t \leq 189002726950466.9:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
(FPCore (x y z t)
:precision binary64
(if (<= t -8.62393080127238e-60)
(+ (- x (/ y (* z 3.0))) (/ t (* z (* y 3.0))))
(if (<= t 189002726950466.9)
(fma (/ -0.3333333333333333 z) (- y (/ t y)) x)
(+ (- x (/ (/ y z) 3.0)) (/ t (* y (* z 3.0)))))))double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.62393080127238e-60) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)));
} else if (t <= 189002726950466.9) {
tmp = fma((-0.3333333333333333 / z), (y - (t / y)), x);
} else {
tmp = (x - ((y / z) / 3.0)) + (t / (y * (z * 3.0)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 3.4 |
|---|---|
| Target | 1.6 |
| Herbie | 0.5 |
if t < -8.6239308012723796e-60Initial program 0.7
Applied associate-*l*_binary640.7
Simplified0.7
if -8.6239308012723796e-60 < t < 189002726950466.906Initial program 5.8
Simplified0.3
if 189002726950466.906 < t Initial program 0.6
Applied associate-/r*_binary640.6
Final simplification0.5
herbie shell --seed 2021280
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))