\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 (x + (y * (z - x))) / z;
}
double code(double x, double y, double z) {
return y + ((x / z) * (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 |
| Alternative 1 | |
|---|---|
| Error | 0.8 |
| Cost | 776 |
| Alternative 2 | |
|---|---|
| Error | 6.2 |
| Cost | 1229 |
| Alternative 3 | |
|---|---|
| Error | 8.9 |
| Cost | 320 |
| Alternative 4 | |
|---|---|
| Error | 20.2 |
| Cost | 834 |
| Alternative 5 | |
|---|---|
| Error | 31.7 |
| Cost | 64 |
| Alternative 6 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |
| Alternative 7 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |

Initial program 10.1
Taylor expanded around 0 3.4
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021044
(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))