\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;t \leq -6.22726511139875 \cdot 10^{+176}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{elif}\;t \leq 5.53228479313245 \cdot 10^{-26}:\\
\;\;\;\;x + \frac{1}{\frac{z \cdot 3}{\frac{t}{y} - y}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\right) - 0.3333333333333333 \cdot \frac{y}{z}\\
\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 -6.22726511139875e+176)
(+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))
(if (<= t 5.53228479313245e-26)
(+ x (/ 1.0 (/ (* z 3.0) (- (/ t y) y))))
(-
(+ x (* 0.3333333333333333 (/ t (* y z))))
(* 0.3333333333333333 (/ y z))))))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 <= -6.22726511139875e+176) {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
} else if (t <= 5.53228479313245e-26) {
tmp = x + (1.0 / ((z * 3.0) / ((t / y) - y)));
} else {
tmp = (x + (0.3333333333333333 * (t / (y * z)))) - (0.3333333333333333 * (y / z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.0 |
|---|---|
| Target | 1.8 |
| Herbie | 1.2 |
if t < -6.2272651113987501e176Initial program 1.3
if -6.2272651113987501e176 < t < 5.53228479313245034e-26Initial program 5.4
Simplified1.3
Applied fma-udef_binary641.3
Simplified1.3
Applied clear-num_binary641.4
Applied clear-num_binary641.4
Simplified1.3
Applied associate-*r/_binary641.3
Simplified1.3
if 5.53228479313245034e-26 < t Initial program 0.6
Simplified8.7
Taylor expanded in z around 0 0.6
Final simplification1.2
herbie shell --seed 2021313
(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))))