\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\frac{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, b \cdot \left(-b \cdot b\right)\right)}{\sqrt[3]{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, b \cdot b + \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, b \cdot b + \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}\right)\right)}}{\sqrt[3]{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, b \cdot b + \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}{3 \cdot a}double f(double a, double b, double c) {
double r2949275 = b;
double r2949276 = -r2949275;
double r2949277 = r2949275 * r2949275;
double r2949278 = 3.0;
double r2949279 = a;
double r2949280 = r2949278 * r2949279;
double r2949281 = c;
double r2949282 = r2949280 * r2949281;
double r2949283 = r2949277 - r2949282;
double r2949284 = sqrt(r2949283);
double r2949285 = r2949276 + r2949284;
double r2949286 = r2949285 / r2949280;
return r2949286;
}
double f(double a, double b, double c) {
double r2949287 = -3.0;
double r2949288 = c;
double r2949289 = a;
double r2949290 = r2949288 * r2949289;
double r2949291 = b;
double r2949292 = r2949291 * r2949291;
double r2949293 = fma(r2949287, r2949290, r2949292);
double r2949294 = sqrt(r2949293);
double r2949295 = -r2949292;
double r2949296 = r2949291 * r2949295;
double r2949297 = fma(r2949293, r2949294, r2949296);
double r2949298 = r2949292 + r2949293;
double r2949299 = fma(r2949291, r2949294, r2949298);
double r2949300 = cbrt(r2949299);
double r2949301 = log1p(r2949300);
double r2949302 = expm1(r2949301);
double r2949303 = r2949300 * r2949302;
double r2949304 = r2949297 / r2949303;
double r2949305 = r2949304 / r2949300;
double r2949306 = 3.0;
double r2949307 = r2949306 * r2949289;
double r2949308 = r2949305 / r2949307;
return r2949308;
}



Bits error versus a



Bits error versus b



Bits error versus c
Initial program 28.9
Simplified28.9
rmApplied flip3--28.9
Simplified28.3
Simplified28.3
rmApplied fma-neg27.7
rmApplied add-cube-cbrt27.7
Applied associate-/r*27.7
rmApplied expm1-log1p-u27.7
Final simplification27.7
herbie shell --seed 2019146 +o rules:numerics
(FPCore (a b c)
:name "Cubic critical, narrow range"
:pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))