\frac{x + y \cdot \left(z - x\right)}{z}y + \frac{x}{z} \cdot \left(1 - y\right)(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
(FPCore (x y z) :precision binary64 (+ y (* (/ x z) (- 1.0 y))))
double code(double x, double y, double z) {
return (((double) (x + ((double) (y * ((double) (z - x)))))) / z);
}
double code(double x, double y, double z) {
return ((double) (y + ((double) ((x / z) * ((double) (1.0 - y))))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.1 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program Error: 10.1 bits
SimplifiedError: 3.4 bits
rmApplied add-cube-cbrtError: 3.9 bits
Applied *-un-lft-identityError: 3.9 bits
Applied times-fracError: 3.9 bits
Applied associate-*r*Error: 1.4 bits
SimplifiedError: 1.4 bits
rmApplied pow1Error: 1.4 bits
Applied pow1Error: 1.4 bits
Applied pow-prod-downError: 1.4 bits
SimplifiedError: 0.0 bits
Final simplificationError: 0.0 bits
herbie shell --seed 2020203
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:herbie-target
(- (+ y (/ x z)) (/ y (/ z x)))
(/ (+ x (* y (- z x))) z))