\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3}\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2.570036506191861 \cdot 10^{+102}:\\
\;\;\;\;\sqrt[3]{\left(2 \cdot \sqrt{x}\right) \cdot \cos y} \cdot \left(\sqrt[3]{\left(2 \cdot \sqrt{x}\right) \cdot \cos y} \cdot \left({x}^{0.16666666666666666} \cdot \sqrt[3]{2}\right)\right) - \frac{a}{b \cdot 3}\\
\mathbf{elif}\;z \cdot t \leq 2.827322437420617 \cdot 10^{+49}:\\
\;\;\;\;\left(\left(2 \cdot \sqrt{x}\right) \cdot \left(\cos y \cdot \cos \left(\frac{z \cdot t}{3}\right)\right) + \left(2 \cdot \sqrt{x}\right) \cdot \left(\sin y \cdot \sin \left(\frac{z \cdot t}{3}\right)\right)\right) - \frac{a}{b \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\left(2 \cdot \sqrt{x}\right) \cdot \cos y} \cdot \left({\left(\sqrt[3]{2}\right)}^{2} \cdot \sqrt[3]{x}\right) - \frac{a}{b \cdot 3}\\
\end{array}(FPCore (x y z t a b) :precision binary64 (- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))
(FPCore (x y z t a b)
:precision binary64
(if (<= (* z t) -2.570036506191861e+102)
(-
(*
(cbrt (* (* 2.0 (sqrt x)) (cos y)))
(*
(cbrt (* (* 2.0 (sqrt x)) (cos y)))
(* (pow x 0.16666666666666666) (cbrt 2.0))))
(/ a (* b 3.0)))
(if (<= (* z t) 2.827322437420617e+49)
(-
(+
(* (* 2.0 (sqrt x)) (* (cos y) (cos (/ (* z t) 3.0))))
(* (* 2.0 (sqrt x)) (* (sin y) (sin (/ (* z t) 3.0)))))
(/ a (* b 3.0)))
(-
(* (cbrt (* (* 2.0 (sqrt x)) (cos y))) (* (pow (cbrt 2.0) 2.0) (cbrt x)))
(/ a (* b 3.0))))))double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * sqrt(x)) * cos(y - ((z * t) / 3.0))) - (a / (b * 3.0));
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * t) <= -2.570036506191861e+102) {
tmp = (cbrt((2.0 * sqrt(x)) * cos(y)) * (cbrt((2.0 * sqrt(x)) * cos(y)) * (pow(x, 0.16666666666666666) * cbrt(2.0)))) - (a / (b * 3.0));
} else if ((z * t) <= 2.827322437420617e+49) {
tmp = (((2.0 * sqrt(x)) * (cos(y) * cos((z * t) / 3.0))) + ((2.0 * sqrt(x)) * (sin(y) * sin((z * t) / 3.0)))) - (a / (b * 3.0));
} else {
tmp = (cbrt((2.0 * sqrt(x)) * cos(y)) * (pow(cbrt(2.0), 2.0) * cbrt(x))) - (a / (b * 3.0));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 20.3 |
|---|---|
| Target | 18.3 |
| Herbie | 16.0 |
if (*.f64 z t) < -2.57003650619186079e102Initial program 44.2
Taylor expanded around 0 33.3
rmApplied add-cube-cbrt_binary64_1614033.3
Taylor expanded around 0 32.9
if -2.57003650619186079e102 < (*.f64 z t) < 2.82732243742061699e49Initial program 6.3
rmApplied cos-diff_binary64_162425.6
Applied distribute-rgt-in_binary64_160555.6
if 2.82732243742061699e49 < (*.f64 z t) Initial program 42.0
Taylor expanded around 0 32.7
rmApplied add-cube-cbrt_binary64_1614032.7
Taylor expanded around 0 32.6
Simplified32.6
Final simplification16.0
herbie shell --seed 2021007
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, K"
:precision binary64
:herbie-target
(if (< z -1.3793337487235141e+129) (- (* (* 2.0 (sqrt x)) (cos (- (/ 1.0 y) (/ (/ 0.3333333333333333 z) t)))) (/ (/ a 3.0) b)) (if (< z 3.516290613555987e+106) (- (* (* (sqrt x) 2.0) (cos (- y (* (/ t 3.0) z)))) (/ (/ a 3.0) b)) (- (* (cos (- y (/ (/ 0.3333333333333333 z) t))) (* 2.0 (sqrt x))) (/ (/ a b) 3.0))))
(- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))