\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}
\mathbf{if}\;c \le -1.252202118917326 \cdot 10^{240}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{x}{z \cdot c} \cdot y, \frac{b}{z \cdot c} - 4 \cdot \frac{a}{\frac{c}{t}}\right)\\
\mathbf{elif}\;c \le -32082327.647484176:\\
\;\;\;\;\mathsf{fma}\left(9, \left(\frac{1}{z} \cdot \frac{x}{c}\right) \cdot y, \frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\right)\\
\mathbf{elif}\;c \le 0.00144591862123770866:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{elif}\;c \le 3.1709786398942339 \cdot 10^{235}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{x}{\frac{z \cdot c}{y}}, \frac{b}{z \cdot c} - 4 \cdot \left(\frac{a}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{t}{\sqrt[3]{c}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{\frac{x}{z}}{\frac{c}{y}}, \frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c) {
double r738154 = x;
double r738155 = 9.0;
double r738156 = r738154 * r738155;
double r738157 = y;
double r738158 = r738156 * r738157;
double r738159 = z;
double r738160 = 4.0;
double r738161 = r738159 * r738160;
double r738162 = t;
double r738163 = r738161 * r738162;
double r738164 = a;
double r738165 = r738163 * r738164;
double r738166 = r738158 - r738165;
double r738167 = b;
double r738168 = r738166 + r738167;
double r738169 = c;
double r738170 = r738159 * r738169;
double r738171 = r738168 / r738170;
return r738171;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r738172 = c;
double r738173 = -1.252202118917326e+240;
bool r738174 = r738172 <= r738173;
double r738175 = 9.0;
double r738176 = x;
double r738177 = z;
double r738178 = r738177 * r738172;
double r738179 = r738176 / r738178;
double r738180 = y;
double r738181 = r738179 * r738180;
double r738182 = b;
double r738183 = r738182 / r738178;
double r738184 = 4.0;
double r738185 = a;
double r738186 = t;
double r738187 = r738172 / r738186;
double r738188 = r738185 / r738187;
double r738189 = r738184 * r738188;
double r738190 = r738183 - r738189;
double r738191 = fma(r738175, r738181, r738190);
double r738192 = -32082327.647484176;
bool r738193 = r738172 <= r738192;
double r738194 = 1.0;
double r738195 = r738194 / r738177;
double r738196 = r738176 / r738172;
double r738197 = r738195 * r738196;
double r738198 = r738197 * r738180;
double r738199 = r738185 * r738186;
double r738200 = r738199 / r738172;
double r738201 = r738184 * r738200;
double r738202 = r738183 - r738201;
double r738203 = fma(r738175, r738198, r738202);
double r738204 = 0.0014459186212377087;
bool r738205 = r738172 <= r738204;
double r738206 = -r738184;
double r738207 = r738186 * r738185;
double r738208 = r738207 / r738172;
double r738209 = r738175 * r738176;
double r738210 = fma(r738209, r738180, r738182);
double r738211 = r738210 / r738177;
double r738212 = r738211 / r738172;
double r738213 = fma(r738206, r738208, r738212);
double r738214 = 3.170978639894234e+235;
bool r738215 = r738172 <= r738214;
double r738216 = r738178 / r738180;
double r738217 = r738176 / r738216;
double r738218 = cbrt(r738172);
double r738219 = r738218 * r738218;
double r738220 = r738185 / r738219;
double r738221 = r738186 / r738218;
double r738222 = r738220 * r738221;
double r738223 = r738184 * r738222;
double r738224 = r738183 - r738223;
double r738225 = fma(r738175, r738217, r738224);
double r738226 = r738176 / r738177;
double r738227 = r738172 / r738180;
double r738228 = r738226 / r738227;
double r738229 = fma(r738175, r738228, r738202);
double r738230 = r738215 ? r738225 : r738229;
double r738231 = r738205 ? r738213 : r738230;
double r738232 = r738193 ? r738203 : r738231;
double r738233 = r738174 ? r738191 : r738232;
return r738233;
}




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.8 |
|---|---|
| Target | 14.8 |
| Herbie | 8.1 |
if c < -1.252202118917326e+240Initial program 27.0
Simplified20.5
Taylor expanded around 0 20.5
Simplified20.5
rmApplied associate-/l*18.7
rmApplied associate-/r/18.7
rmApplied associate-/l*14.4
if -1.252202118917326e+240 < c < -32082327.647484176Initial program 22.0
Simplified13.5
Taylor expanded around 0 13.5
Simplified13.5
rmApplied associate-/l*11.4
rmApplied associate-/r/11.2
rmApplied *-un-lft-identity11.2
Applied times-frac9.3
if -32082327.647484176 < c < 0.0014459186212377087Initial program 14.9
Simplified5.3
rmApplied associate-/r*2.7
Simplified2.7
if 0.0014459186212377087 < c < 3.170978639894234e+235Initial program 22.3
Simplified13.9
Taylor expanded around 0 13.9
Simplified13.9
rmApplied associate-/l*12.1
rmApplied add-cube-cbrt12.4
Applied times-frac8.1
if 3.170978639894234e+235 < c Initial program 28.6
Simplified20.2
Taylor expanded around 0 20.1
Simplified20.1
rmApplied associate-/l*18.6
rmApplied *-un-lft-identity18.6
Applied times-frac16.0
Applied associate-/r*17.9
Simplified17.9
Final simplification8.1
herbie shell --seed 2020062 +o rules:numerics
(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) y) (* (* (* z 4) t) a)) b) (* z c)) -1.1001567408041051e-171) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -0.0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)))