\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.9189385332046700050057097541866824030876\right) + \frac{\left(\left(y + 7.936500793651000149400709382518925849581 \cdot 10^{-4}\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \cdot z + 0.08333333333333299564049667651488562114537}{x}\begin{array}{l}
\mathbf{if}\;z \cdot \left(\left(7.936500793651000149400709382518925849581 \cdot 10^{-4} + y\right) \cdot z - 0.002777777777777800001512975569539776188321\right) = -\infty:\\
\;\;\;\;\frac{1}{\left(\frac{\frac{\frac{x}{z}}{z}}{y} + \frac{x}{\left(z \cdot y\right) \cdot \left(z \cdot y\right)} \cdot \frac{6.29880448476229567390436391016717010416 \cdot 10^{-7}}{y}\right) - \frac{x}{\left(z \cdot y\right) \cdot \left(z \cdot y\right)} \cdot 7.936500793651000149400709382518925849581 \cdot 10^{-4}} + \left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(x - 0.5\right) + \left(0.9189385332046700050057097541866824030876 + \left(\left(x - 0.5\right) \cdot \log \left({x}^{\frac{1}{3}}\right) - x\right)\right)\right)\\
\mathbf{elif}\;z \cdot \left(\left(7.936500793651000149400709382518925849581 \cdot 10^{-4} + y\right) \cdot z - 0.002777777777777800001512975569539776188321\right) \le 2.413037256038914791422685382082884363974 \cdot 10^{296}:\\
\;\;\;\;\frac{1}{\frac{x}{0.08333333333333299564049667651488562114537 + z \cdot \left(\left(7.936500793651000149400709382518925849581 \cdot 10^{-4} + y\right) \cdot z - 0.002777777777777800001512975569539776188321\right)}} + \left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(x - 0.5\right) + \left(0.9189385332046700050057097541866824030876 + \left(\left(x - 0.5\right) \cdot \log \left({x}^{\frac{1}{3}}\right) - x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(\frac{\frac{\frac{x}{z}}{z}}{y} + \frac{x}{\left(z \cdot y\right) \cdot \left(z \cdot y\right)} \cdot \frac{6.29880448476229567390436391016717010416 \cdot 10^{-7}}{y}\right) - \frac{x}{\left(z \cdot y\right) \cdot \left(z \cdot y\right)} \cdot 7.936500793651000149400709382518925849581 \cdot 10^{-4}} + \left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(x - 0.5\right) + \left(0.9189385332046700050057097541866824030876 + \left(\left(x - 0.5\right) \cdot \log \left({x}^{\frac{1}{3}}\right) - x\right)\right)\right)\\
\end{array}double f(double x, double y, double z) {
double r16327243 = x;
double r16327244 = 0.5;
double r16327245 = r16327243 - r16327244;
double r16327246 = log(r16327243);
double r16327247 = r16327245 * r16327246;
double r16327248 = r16327247 - r16327243;
double r16327249 = 0.91893853320467;
double r16327250 = r16327248 + r16327249;
double r16327251 = y;
double r16327252 = 0.0007936500793651;
double r16327253 = r16327251 + r16327252;
double r16327254 = z;
double r16327255 = r16327253 * r16327254;
double r16327256 = 0.0027777777777778;
double r16327257 = r16327255 - r16327256;
double r16327258 = r16327257 * r16327254;
double r16327259 = 0.083333333333333;
double r16327260 = r16327258 + r16327259;
double r16327261 = r16327260 / r16327243;
double r16327262 = r16327250 + r16327261;
return r16327262;
}
double f(double x, double y, double z) {
double r16327263 = z;
double r16327264 = 0.0007936500793651;
double r16327265 = y;
double r16327266 = r16327264 + r16327265;
double r16327267 = r16327266 * r16327263;
double r16327268 = 0.0027777777777778;
double r16327269 = r16327267 - r16327268;
double r16327270 = r16327263 * r16327269;
double r16327271 = -inf.0;
bool r16327272 = r16327270 <= r16327271;
double r16327273 = 1.0;
double r16327274 = x;
double r16327275 = r16327274 / r16327263;
double r16327276 = r16327275 / r16327263;
double r16327277 = r16327276 / r16327265;
double r16327278 = r16327263 * r16327265;
double r16327279 = r16327278 * r16327278;
double r16327280 = r16327274 / r16327279;
double r16327281 = 6.298804484762296e-07;
double r16327282 = r16327281 / r16327265;
double r16327283 = r16327280 * r16327282;
double r16327284 = r16327277 + r16327283;
double r16327285 = r16327280 * r16327264;
double r16327286 = r16327284 - r16327285;
double r16327287 = r16327273 / r16327286;
double r16327288 = cbrt(r16327274);
double r16327289 = r16327288 * r16327288;
double r16327290 = log(r16327289);
double r16327291 = 0.5;
double r16327292 = r16327274 - r16327291;
double r16327293 = r16327290 * r16327292;
double r16327294 = 0.91893853320467;
double r16327295 = 0.3333333333333333;
double r16327296 = pow(r16327274, r16327295);
double r16327297 = log(r16327296);
double r16327298 = r16327292 * r16327297;
double r16327299 = r16327298 - r16327274;
double r16327300 = r16327294 + r16327299;
double r16327301 = r16327293 + r16327300;
double r16327302 = r16327287 + r16327301;
double r16327303 = 2.4130372560389148e+296;
bool r16327304 = r16327270 <= r16327303;
double r16327305 = 0.083333333333333;
double r16327306 = r16327305 + r16327270;
double r16327307 = r16327274 / r16327306;
double r16327308 = r16327273 / r16327307;
double r16327309 = r16327308 + r16327301;
double r16327310 = r16327304 ? r16327309 : r16327302;
double r16327311 = r16327272 ? r16327302 : r16327310;
return r16327311;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.8 |
|---|---|
| Target | 1.2 |
| Herbie | 2.1 |
if (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) < -inf.0 or 2.4130372560389148e+296 < (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) Initial program 60.5
rmApplied add-cube-cbrt60.5
Applied log-prod60.5
Applied distribute-lft-in60.5
Applied associate--l+60.5
Applied associate-+l+60.5
rmApplied pow1/360.5
rmApplied clear-num60.5
Taylor expanded around inf 62.1
Simplified19.7
if -inf.0 < (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) < 2.4130372560389148e+296Initial program 0.2
rmApplied add-cube-cbrt0.2
Applied log-prod0.3
Applied distribute-lft-in0.3
Applied associate--l+0.3
Applied associate-+l+0.3
rmApplied pow1/30.2
rmApplied clear-num0.3
Final simplification2.1
herbie shell --seed 2019172
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))