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