x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \leq -8.717304416683607 \cdot 10^{-82}:\\
\;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\left(y \cdot \frac{\sqrt[3]{{\left(\sqrt[3]{x}\right)}^{2}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{z}}\right)\\
\mathbf{elif}\;\frac{y}{z} \leq 7.655047405253071 \cdot 10^{-201}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;\frac{y}{z} \leq 7.55957540953951 \cdot 10^{+202}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}(FPCore (x y z t) :precision binary64 (* x (/ (* (/ y z) t) t)))
(FPCore (x y z t)
:precision binary64
(if (<= (/ y z) -8.717304416683607e-82)
(*
(* (cbrt x) (cbrt x))
(*
(* y (/ (cbrt (pow (cbrt x) 2.0)) (* (cbrt z) (cbrt z))))
(/ (cbrt (cbrt x)) (cbrt z))))
(if (<= (/ y z) 7.655047405253071e-201)
(* y (/ x z))
(if (<= (/ y z) 7.55957540953951e+202)
(* (/ y z) x)
(* (* y x) (/ 1.0 z))))))double code(double x, double y, double z, double t) {
return ((double) (x * (((double) ((y / z) * t)) / t)));
}
double code(double x, double y, double z, double t) {
double tmp;
if (((y / z) <= -8.717304416683607e-82)) {
tmp = ((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * ((double) (((double) (y * (((double) cbrt(((double) pow(((double) cbrt(x)), 2.0)))) / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))))) * (((double) cbrt(((double) cbrt(x)))) / ((double) cbrt(z)))))));
} else {
double tmp_1;
if (((y / z) <= 7.655047405253071e-201)) {
tmp_1 = ((double) (y * (x / z)));
} else {
double tmp_2;
if (((y / z) <= 7.55957540953951e+202)) {
tmp_2 = ((double) ((y / z) * x));
} else {
tmp_2 = ((double) (((double) (y * x)) * (1.0 / z)));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.9 |
|---|---|
| Target | 1.4 |
| Herbie | 2.2 |
if (/ y z) < -8.7173044166836066e-82Initial program Error: 15.7 bits
SimplifiedError: 6.6 bits
rmApplied add-cube-cbrtError: 7.6 bits
Applied associate-*l*Error: 7.6 bits
SimplifiedError: 7.1 bits
rmApplied add-cube-cbrtError: 7.3 bits
Applied add-cube-cbrtError: 7.4 bits
Applied cbrt-prodError: 7.4 bits
Applied times-fracError: 7.4 bits
Applied associate-*r*Error: 5.1 bits
SimplifiedError: 5.1 bits
if -8.7173044166836066e-82 < (/ y z) < 7.65504740525307086e-201Initial program Error: 14.8 bits
SimplifiedError: 7.7 bits
rmApplied add-cube-cbrtError: 8.1 bits
Applied associate-*l*Error: 8.1 bits
SimplifiedError: 5.1 bits
Taylor expanded around 0 Error: 1.9 bits
SimplifiedError: 1.9 bits
if 7.65504740525307086e-201 < (/ y z) < 7.55957540953951011e202Initial program Error: 9.3 bits
SimplifiedError: 0.2 bits
if 7.55957540953951011e202 < (/ y z) Initial program Error: 43.4 bits
SimplifiedError: 29.0 bits
rmApplied div-invError: 29.0 bits
Applied associate-*r*Error: 1.2 bits
Final simplificationError: 2.2 bits
herbie shell --seed 2020203
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
:precision binary64
:herbie-target
(if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))
(* x (/ (* (/ y z) t) t)))