\frac{x - y}{z - y}\frac{x}{z - y} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{z - y} \cdot y\right)\right)double f(double x, double y, double z) {
double r25649928 = x;
double r25649929 = y;
double r25649930 = r25649928 - r25649929;
double r25649931 = z;
double r25649932 = r25649931 - r25649929;
double r25649933 = r25649930 / r25649932;
return r25649933;
}
double f(double x, double y, double z) {
double r25649934 = x;
double r25649935 = z;
double r25649936 = y;
double r25649937 = r25649935 - r25649936;
double r25649938 = r25649934 / r25649937;
double r25649939 = 1.0;
double r25649940 = r25649939 / r25649937;
double r25649941 = r25649940 * r25649936;
double r25649942 = expm1(r25649941);
double r25649943 = log1p(r25649942);
double r25649944 = r25649938 - r25649943;
return r25649944;
}




Bits error versus x




Bits error versus y




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