\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -1.446414607682033344844893055916604547379 \cdot 10^{-250}:\\
\;\;\;\;\left(x \cdot \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}\right) \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{y}}\\
\mathbf{elif}\;y \le 3572580006165377287364755677987733504:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}double f(double x, double y, double z) {
double r848545 = x;
double r848546 = y;
double r848547 = z;
double r848548 = r848546 - r848547;
double r848549 = r848545 * r848548;
double r848550 = r848549 / r848546;
return r848550;
}
double f(double x, double y, double z) {
double r848551 = y;
double r848552 = -1.4464146076820333e-250;
bool r848553 = r848551 <= r848552;
double r848554 = x;
double r848555 = z;
double r848556 = r848551 - r848555;
double r848557 = cbrt(r848556);
double r848558 = r848557 * r848557;
double r848559 = cbrt(r848551);
double r848560 = r848559 * r848559;
double r848561 = r848558 / r848560;
double r848562 = r848554 * r848561;
double r848563 = r848557 / r848559;
double r848564 = r848562 * r848563;
double r848565 = 3.572580006165377e+36;
bool r848566 = r848551 <= r848565;
double r848567 = r848554 * r848555;
double r848568 = r848567 / r848551;
double r848569 = r848554 - r848568;
double r848570 = r848556 / r848551;
double r848571 = r848554 * r848570;
double r848572 = r848566 ? r848569 : r848571;
double r848573 = r848553 ? r848564 : r848572;
return r848573;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 13.0 |
|---|---|
| Target | 3.4 |
| Herbie | 1.4 |
if y < -1.4464146076820333e-250Initial program 13.1
rmApplied *-un-lft-identity13.1
Applied times-frac2.5
Simplified2.5
rmApplied add-cube-cbrt3.7
Applied add-cube-cbrt3.0
Applied times-frac3.0
Applied associate-*r*0.8
if -1.4464146076820333e-250 < y < 3.572580006165377e+36Initial program 6.3
rmApplied *-un-lft-identity6.3
Applied times-frac8.1
Simplified8.1
rmApplied add-cube-cbrt9.2
Applied associate-*l*9.2
Taylor expanded around 0 3.7
if 3.572580006165377e+36 < y Initial program 19.6
rmApplied *-un-lft-identity19.6
Applied times-frac0.1
Simplified0.1
Final simplification1.4
herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))