x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le -6.13689162563550475538429628460746343967 \cdot 10^{60}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{e^{-z}}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}, \frac{\sqrt{e^{-z}}}{\sqrt[3]{y}}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z + y}}\right)\right) \cdot y + y \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z + y}}\right)}}{y}\\
\end{array}double f(double x, double y, double z) {
double r247358 = x;
double r247359 = y;
double r247360 = z;
double r247361 = r247360 + r247359;
double r247362 = r247359 / r247361;
double r247363 = log(r247362);
double r247364 = r247359 * r247363;
double r247365 = exp(r247364);
double r247366 = r247365 / r247359;
double r247367 = r247358 + r247366;
return r247367;
}
double f(double x, double y, double z) {
double r247368 = y;
double r247369 = -6.136891625635505e+60;
bool r247370 = r247368 <= r247369;
double r247371 = z;
double r247372 = -r247371;
double r247373 = exp(r247372);
double r247374 = sqrt(r247373);
double r247375 = cbrt(r247368);
double r247376 = r247375 * r247375;
double r247377 = r247374 / r247376;
double r247378 = r247374 / r247375;
double r247379 = x;
double r247380 = fma(r247377, r247378, r247379);
double r247381 = 2.0;
double r247382 = r247371 + r247368;
double r247383 = cbrt(r247382);
double r247384 = r247375 / r247383;
double r247385 = log(r247384);
double r247386 = r247381 * r247385;
double r247387 = r247386 * r247368;
double r247388 = r247368 * r247385;
double r247389 = r247387 + r247388;
double r247390 = exp(r247389);
double r247391 = r247390 / r247368;
double r247392 = r247379 + r247391;
double r247393 = r247370 ? r247380 : r247392;
return r247393;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 6.0 |
|---|---|
| Target | 1.0 |
| Herbie | 0.6 |
if y < -6.136891625635505e+60Initial program 2.4
Taylor expanded around inf 0.1
Simplified0.1
rmApplied add-cube-cbrt0.3
Applied add-sqr-sqrt0.3
Applied times-frac0.3
Applied fma-def0.3
if -6.136891625635505e+60 < y Initial program 6.9
rmApplied add-cube-cbrt15.0
Applied add-cube-cbrt6.9
Applied times-frac6.9
Applied log-prod1.9
Applied distribute-lft-in1.9
Simplified0.7
Final simplification0.6
herbie shell --seed 2019326 +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.1154157597908e-315) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))