\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\begin{array}{l}
t_1 := 4 \cdot \frac{t \cdot a}{c}\\
t_2 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\left(\frac{\sqrt[3]{b} \cdot \sqrt[3]{b}}{\frac{c}{\frac{\sqrt[3]{b}}{z}}} + 9 \cdot \frac{x \cdot \frac{y}{c}}{z}\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{b}{z \cdot c}\\
t_4 := t_3 + 9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{if}\;t_2 \leq -3.6590373263643594 \cdot 10^{-177}:\\
\;\;\;\;t_4 - t_1\\
\mathbf{elif}\;t_2 \leq 1.2723756627530677 \cdot 10^{+31}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\
\mathbf{elif}\;t_2 \leq 5.254822180873033 \cdot 10^{+305}:\\
\;\;\;\;t_4 - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_3 + \left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z}\right) - t_1\\
\end{array}\\
\end{array}
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 4.0 (/ (* t a) c)))
(t_2 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_2 (- INFINITY))
(-
(+
(/ (* (cbrt b) (cbrt b)) (/ c (/ (cbrt b) z)))
(* 9.0 (/ (* x (/ y c)) z)))
t_1)
(let* ((t_3 (/ b (* z c))) (t_4 (+ t_3 (* 9.0 (/ (* x y) (* z c))))))
(if (<= t_2 -3.6590373263643594e-177)
(- t_4 t_1)
(if (<= t_2 1.2723756627530677e+31)
(/ (fma t (* a -4.0) (/ (fma x (* 9.0 y) b) z)) c)
(if (<= t_2 5.254822180873033e+305)
(- t_4 (* 4.0 (* a (/ t c))))
(- (+ t_3 (* (* 9.0 (/ y c)) (/ x z))) t_1))))))))double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 4.0 * ((t * a) / c);
double t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (((cbrt(b) * cbrt(b)) / (c / (cbrt(b) / z))) + (9.0 * ((x * (y / c)) / z))) - t_1;
} else {
double t_3 = b / (z * c);
double t_4 = t_3 + (9.0 * ((x * y) / (z * c)));
double tmp_1;
if (t_2 <= -3.6590373263643594e-177) {
tmp_1 = t_4 - t_1;
} else if (t_2 <= 1.2723756627530677e+31) {
tmp_1 = fma(t, (a * -4.0), (fma(x, (9.0 * y), b) / z)) / c;
} else if (t_2 <= 5.254822180873033e+305) {
tmp_1 = t_4 - (4.0 * (a * (t / c)));
} else {
tmp_1 = (t_3 + ((9.0 * (y / c)) * (x / z))) - t_1;
}
tmp = tmp_1;
}
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




Bits error versus c
| Original | 20.7 |
|---|---|
| Target | 15.0 |
| Herbie | 6.3 |
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -inf.0Initial program 64.0
Simplified26.5
Taylor expanded in t around 0 30.8
Applied associate-/r*_binary6433.1
Simplified24.9
Applied add-cube-cbrt_binary6425.0
Applied associate-/l*_binary6425.0
Simplified23.0
if -inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -3.65903732636435944e-177Initial program 0.8
Simplified10.0
Taylor expanded in t around 0 2.6
if -3.65903732636435944e-177 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 1.2723756627530677e31Initial program 17.4
Simplified0.8
Applied *-un-lft-identity_binary640.8
Applied associate-/r*_binary640.8
if 1.2723756627530677e31 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 5.25482218087303271e305Initial program 0.7
Simplified14.4
Taylor expanded in t around 0 3.8
Applied *-un-lft-identity_binary643.8
Applied times-frac_binary642.4
Simplified2.4
if 5.25482218087303271e305 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 63.5
Simplified28.1
Taylor expanded in t around 0 31.5
Applied times-frac_binary6417.4
Applied associate-*r*_binary6417.4
Final simplification6.3
herbie shell --seed 2021275
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))