x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 2.82172074555303536154305440376197327804 \cdot 10^{-37}:\\
\;\;\;\;x + \frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z + y}}\right)\right) \cdot y}}{\frac{y}{{\left(\frac{\sqrt[3]{y}}{\sqrt[3]{z + y}}\right)}^{y}}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r259207 = x;
double r259208 = y;
double r259209 = z;
double r259210 = r259209 + r259208;
double r259211 = r259208 / r259210;
double r259212 = log(r259211);
double r259213 = r259208 * r259212;
double r259214 = exp(r259213);
double r259215 = r259214 / r259208;
double r259216 = r259207 + r259215;
return r259216;
}
double f(double x, double y, double z) {
double r259217 = y;
double r259218 = 2.8217207455530354e-37;
bool r259219 = r259217 <= r259218;
double r259220 = x;
double r259221 = 2.0;
double r259222 = cbrt(r259217);
double r259223 = z;
double r259224 = r259223 + r259217;
double r259225 = cbrt(r259224);
double r259226 = r259222 / r259225;
double r259227 = log(r259226);
double r259228 = r259221 * r259227;
double r259229 = r259228 * r259217;
double r259230 = exp(r259229);
double r259231 = pow(r259226, r259217);
double r259232 = r259217 / r259231;
double r259233 = r259230 / r259232;
double r259234 = r259220 + r259233;
double r259235 = -r259223;
double r259236 = exp(r259235);
double r259237 = r259236 / r259217;
double r259238 = r259220 + r259237;
double r259239 = r259219 ? r259234 : r259238;
return r259239;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 1.1 |
| Herbie | 1.1 |
if y < 2.8217207455530354e-37Initial program 8.4
Simplified8.4
rmApplied add-cube-cbrt20.0
Applied add-cube-cbrt8.4
Applied times-frac8.4
Applied unpow-prod-down2.4
Applied associate-/l*2.4
rmApplied add-exp-log45.8
Applied add-exp-log45.8
Applied prod-exp45.8
Applied add-exp-log45.8
Applied add-exp-log45.8
Applied prod-exp45.8
Applied div-exp45.8
Applied pow-exp45.1
Simplified0.9
if 2.8217207455530354e-37 < y Initial program 1.7
Simplified1.7
Taylor expanded around inf 1.4
Final simplification1.1
herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
:precision binary64
:herbie-target
(if (< (/ y (+ z y)) 7.1154157598e-315) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))