\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 r19764469 = x;
double r19764470 = 0.5;
double r19764471 = r19764469 - r19764470;
double r19764472 = log(r19764469);
double r19764473 = r19764471 * r19764472;
double r19764474 = r19764473 - r19764469;
double r19764475 = 0.91893853320467;
double r19764476 = r19764474 + r19764475;
double r19764477 = y;
double r19764478 = 0.0007936500793651;
double r19764479 = r19764477 + r19764478;
double r19764480 = z;
double r19764481 = r19764479 * r19764480;
double r19764482 = 0.0027777777777778;
double r19764483 = r19764481 - r19764482;
double r19764484 = r19764483 * r19764480;
double r19764485 = 0.083333333333333;
double r19764486 = r19764484 + r19764485;
double r19764487 = r19764486 / r19764469;
double r19764488 = r19764476 + r19764487;
return r19764488;
}
double f(double x, double y, double z) {
double r19764489 = z;
double r19764490 = 0.0007936500793651;
double r19764491 = y;
double r19764492 = r19764490 + r19764491;
double r19764493 = r19764492 * r19764489;
double r19764494 = 0.0027777777777778;
double r19764495 = r19764493 - r19764494;
double r19764496 = r19764489 * r19764495;
double r19764497 = -inf.0;
bool r19764498 = r19764496 <= r19764497;
double r19764499 = 1.0;
double r19764500 = x;
double r19764501 = r19764500 / r19764489;
double r19764502 = r19764501 / r19764489;
double r19764503 = r19764502 / r19764491;
double r19764504 = r19764489 * r19764491;
double r19764505 = r19764504 * r19764504;
double r19764506 = r19764500 / r19764505;
double r19764507 = 6.298804484762296e-07;
double r19764508 = r19764507 / r19764491;
double r19764509 = r19764506 * r19764508;
double r19764510 = r19764503 + r19764509;
double r19764511 = r19764506 * r19764490;
double r19764512 = r19764510 - r19764511;
double r19764513 = r19764499 / r19764512;
double r19764514 = cbrt(r19764500);
double r19764515 = r19764514 * r19764514;
double r19764516 = log(r19764515);
double r19764517 = 0.5;
double r19764518 = r19764500 - r19764517;
double r19764519 = r19764516 * r19764518;
double r19764520 = 0.91893853320467;
double r19764521 = 0.3333333333333333;
double r19764522 = pow(r19764500, r19764521);
double r19764523 = log(r19764522);
double r19764524 = r19764518 * r19764523;
double r19764525 = r19764524 - r19764500;
double r19764526 = r19764520 + r19764525;
double r19764527 = r19764519 + r19764526;
double r19764528 = r19764513 + r19764527;
double r19764529 = 2.4130372560389148e+296;
bool r19764530 = r19764496 <= r19764529;
double r19764531 = 0.083333333333333;
double r19764532 = r19764531 + r19764496;
double r19764533 = r19764500 / r19764532;
double r19764534 = r19764499 / r19764533;
double r19764535 = r19764534 + r19764527;
double r19764536 = r19764530 ? r19764535 : r19764528;
double r19764537 = r19764498 ? r19764528 : r19764536;
return r19764537;
}




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-rgt-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-rgt-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)))