\frac{x - y}{z - y}\frac{x}{z - y} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{z - y}\right)\right)double f(double x, double y, double z) {
double r474054 = x;
double r474055 = y;
double r474056 = r474054 - r474055;
double r474057 = z;
double r474058 = r474057 - r474055;
double r474059 = r474056 / r474058;
return r474059;
}
double f(double x, double y, double z) {
double r474060 = x;
double r474061 = z;
double r474062 = y;
double r474063 = r474061 - r474062;
double r474064 = r474060 / r474063;
double r474065 = r474062 / r474063;
double r474066 = expm1(r474065);
double r474067 = log1p(r474066);
double r474068 = r474064 - r474067;
return r474068;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied div-sub0.0
rmApplied log1p-expm1-u0.0
Final simplification0.0
herbie shell --seed 2020034 +o rules:numerics
(FPCore (x y z)
:name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(- (/ x (- z y)) (/ y (- z y)))
(/ (- x y) (- z y)))