\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.382969987282973 \cdot 10^{+34}:\\
\;\;\;\;\left(x - \frac{1}{z} \cdot \frac{y}{3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := x - \frac{\frac{y}{z}}{3}\\
\mathbf{if}\;t \leq 551368187064176000:\\
\;\;\;\;t_1 + \frac{0.3333333333333333}{z} \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\end{array}\\
\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.382969987282973e+34)
(+ (- x (* (/ 1.0 z) (/ y 3.0))) (/ t (* y (* z 3.0))))
(let* ((t_1 (- x (/ (/ y z) 3.0))))
(if (<= t 551368187064176000.0)
(+ t_1 (* (/ 0.3333333333333333 z) (/ t y)))
(+ t_1 (/ t (* 3.0 (* z y))))))))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.382969987282973e+34) {
tmp = (x - ((1.0 / z) * (y / 3.0))) + (t / (y * (z * 3.0)));
} else {
double t_1 = x - ((y / z) / 3.0);
double tmp_1;
if (t <= 551368187064176000.0) {
tmp_1 = t_1 + ((0.3333333333333333 / z) * (t / y));
} else {
tmp_1 = t_1 + (t / (3.0 * (z * y)));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.8 |
| Herbie | 0.4 |
if t < -6.3829699872829731e34Initial program 0.8
Applied *-un-lft-identity_binary640.8
Applied times-frac_binary640.8
if -6.3829699872829731e34 < t < 551368187064176000Initial program 5.5
Applied associate-/r*_binary645.5
Applied *-un-lft-identity_binary645.5
Applied times-frac_binary640.2
Simplified0.3
if 551368187064176000 < t Initial program 0.7
Applied associate-/r*_binary640.7
Taylor expanded in z around 0 0.7
Final simplification0.4
herbie shell --seed 2022081
(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))))