\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 9.7500396747249 \cdot 10^{-319} \lor \neg \left(t \cdot t \leq 2.995238407764539 \cdot 10^{+307}\right):\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \left(\frac{z}{t} \cdot \frac{z}{\sqrt[3]{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{y} \cdot \left(x \cdot \left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{y}\right)\right) + z \cdot \frac{z}{t \cdot t}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
(FPCore (x y z t)
:precision binary64
(if (or (<= (* t t) 9.7500396747249e-319)
(not (<= (* t t) 2.995238407764539e+307)))
(+
(* (/ x y) (/ x y))
(* (/ 1.0 (* (cbrt t) (cbrt t))) (* (/ z t) (/ z (cbrt t)))))
(+
(* (/ (cbrt x) y) (* x (* (cbrt x) (/ (cbrt x) y))))
(* z (/ z (* t t))))))double code(double x, double y, double z, double t) {
return ((double) ((((double) (x * x)) / ((double) (y * y))) + (((double) (z * z)) / ((double) (t * t)))));
}
double code(double x, double y, double z, double t) {
double tmp;
if (((((double) (t * t)) <= 9.7500396747249e-319) || !(((double) (t * t)) <= 2.995238407764539e+307))) {
tmp = ((double) (((double) ((x / y) * (x / y))) + ((double) ((1.0 / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))) * ((double) ((z / t) * (z / ((double) cbrt(t)))))))));
} else {
tmp = ((double) (((double) ((((double) cbrt(x)) / y) * ((double) (x * ((double) (((double) cbrt(x)) * (((double) cbrt(x)) / y))))))) + ((double) (z * (z / ((double) (t * t)))))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 33.8 |
|---|---|
| Target | 0.4 |
| Herbie | 1.7 |
if (* t t) < 9.7500397e-319 or 2.995238407764539e307 < (* t t) Initial program Error: 43.4 bits
SimplifiedError: 37.5 bits
rmApplied add-sqr-sqrtError: 51.0 bits
Applied times-fracError: 42.8 bits
Applied add-sqr-sqrtError: 42.8 bits
Applied unswap-sqrError: 38.9 bits
SimplifiedError: 38.8 bits
SimplifiedError: 13.3 bits
rmApplied add-sqr-sqrtError: 38.7 bits
Applied times-fracError: 34.2 bits
Applied add-sqr-sqrtError: 34.3 bits
Applied unswap-sqrError: 32.5 bits
SimplifiedError: 32.4 bits
SimplifiedError: 0.4 bits
rmApplied add-cube-cbrtError: 0.7 bits
Applied *-un-lft-identityError: 0.7 bits
Applied times-fracError: 0.7 bits
Applied associate-*l*Error: 2.0 bits
SimplifiedError: 2.0 bits
if 9.7500397e-319 < (* t t) < 2.995238407764539e307Initial program Error: 25.1 bits
SimplifiedError: 13.1 bits
rmApplied add-cube-cbrtError: 13.4 bits
Applied times-fracError: 4.6 bits
Applied associate-*r*Error: 1.4 bits
SimplifiedError: 1.4 bits
Final simplificationError: 1.7 bits
herbie shell --seed 2020204
(FPCore (x y z t)
:name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
:precision binary64
:herbie-target
(+ (pow (/ x y) 2.0) (pow (/ z t) 2.0))
(+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))