\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;y \leq -2.1478886459578017 \cdot 10^{+264}:\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -1.3406762049438543 \cdot 10^{+127}:\\
\;\;\;\;x + \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{z}\\
\mathbf{elif}\;y \leq 3.1872202114932396 \cdot 10^{+58} \lor \neg \left(y \leq 1.1972472554863538 \cdot 10^{+195}\right):\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
(FPCore (x y z)
:precision binary64
(if (<= y -2.1478886459578017e+264)
(+ x (* x (/ y z)))
(if (<= y -1.3406762049438543e+127)
(+ x (* (* x (* (cbrt y) (cbrt y))) (/ (cbrt y) z)))
(if (or (<= y 3.1872202114932396e+58)
(not (<= y 1.1972472554863538e+195)))
(+ x (* x (/ y z)))
(+ x (* (* y x) (/ 1.0 z)))))))double code(double x, double y, double z) {
return (((double) (x * ((double) (y + z)))) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((y <= -2.1478886459578017e+264)) {
VAR = ((double) (x + ((double) (x * (y / z)))));
} else {
double VAR_1;
if ((y <= -1.3406762049438543e+127)) {
VAR_1 = ((double) (x + ((double) (((double) (x * ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * (((double) cbrt(y)) / z)))));
} else {
double VAR_2;
if (((y <= 3.1872202114932396e+58) || !(y <= 1.1972472554863538e+195))) {
VAR_2 = ((double) (x + ((double) (x * (y / z)))));
} else {
VAR_2 = ((double) (x + ((double) (((double) (y * x)) * (1.0 / z)))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 2.8 |
| Herbie | 3.1 |
if y < -2.1478886459578017e264 or -1.3406762049438543e127 < y < 3.1872202114932396e58 or 1.19724725548635375e195 < y Initial program 12.8
Simplified1.9
if -2.1478886459578017e264 < y < -1.3406762049438543e127Initial program 11.7
Simplified9.3
rmApplied *-un-lft-identity9.3
Applied add-cube-cbrt9.9
Applied times-frac9.9
Applied associate-*r*8.4
Simplified8.4
if 3.1872202114932396e58 < y < 1.19724725548635375e195Initial program 12.7
Simplified7.3
rmApplied div-inv7.3
Applied associate-*r*7.7
Final simplification3.1
herbie shell --seed 2020198
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))