| Alternative 1 | |
|---|---|
| Accuracy | 94.5% |
| Cost | 544 |
\[s \cdot \frac{-1}{0.5 + \left(u \cdot \left(u \cdot 0.6666666666666666 + 0.3333333333333333\right) + \frac{-0.25}{u}\right)}
\]
(FPCore (s u) :precision binary32 (* s (log (/ 1.0 (- 1.0 (* 4.0 u))))))
(FPCore (s u) :precision binary32 (* (log1p (* u -4.0)) (- s)))
float code(float s, float u) {
return s * logf((1.0f / (1.0f - (4.0f * u))));
}
float code(float s, float u) {
return log1pf((u * -4.0f)) * -s;
}
function code(s, u) return Float32(s * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(4.0) * u))))) end
function code(s, u) return Float32(log1p(Float32(u * Float32(-4.0))) * Float32(-s)) end
s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right)
\mathsf{log1p}\left(u \cdot -4\right) \cdot \left(-s\right)
Results
Initial program 60.6%
Simplified99.4%
[Start]60.6 | \[ s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right)
\] |
|---|---|
log-rec [=>]63.1 | \[ s \cdot \color{blue}{\left(-\log \left(1 - 4 \cdot u\right)\right)}
\] |
distribute-rgt-neg-out [=>]63.1 | \[ \color{blue}{-s \cdot \log \left(1 - 4 \cdot u\right)}
\] |
distribute-lft-neg-in [=>]63.1 | \[ \color{blue}{\left(-s\right) \cdot \log \left(1 - 4 \cdot u\right)}
\] |
*-commutative [<=]63.1 | \[ \color{blue}{\log \left(1 - 4 \cdot u\right) \cdot \left(-s\right)}
\] |
sub-neg [=>]63.1 | \[ \log \color{blue}{\left(1 + \left(-4 \cdot u\right)\right)} \cdot \left(-s\right)
\] |
log1p-def [=>]99.4 | \[ \color{blue}{\mathsf{log1p}\left(-4 \cdot u\right)} \cdot \left(-s\right)
\] |
distribute-lft-neg-in [=>]99.4 | \[ \mathsf{log1p}\left(\color{blue}{\left(-4\right) \cdot u}\right) \cdot \left(-s\right)
\] |
*-commutative [=>]99.4 | \[ \mathsf{log1p}\left(\color{blue}{u \cdot \left(-4\right)}\right) \cdot \left(-s\right)
\] |
metadata-eval [=>]99.4 | \[ \mathsf{log1p}\left(u \cdot \color{blue}{-4}\right) \cdot \left(-s\right)
\] |
Final simplification99.4%
| Alternative 1 | |
|---|---|
| Accuracy | 94.5% |
| Cost | 544 |
| Alternative 2 | |
|---|---|
| Accuracy | 92.8% |
| Cost | 480 |
| Alternative 3 | |
|---|---|
| Accuracy | 92.8% |
| Cost | 416 |
| Alternative 4 | |
|---|---|
| Accuracy | 92.8% |
| Cost | 352 |
| Alternative 5 | |
|---|---|
| Accuracy | 89.0% |
| Cost | 224 |
| Alternative 6 | |
|---|---|
| Accuracy | 74.2% |
| Cost | 160 |
| Alternative 7 | |
|---|---|
| Accuracy | 74.4% |
| Cost | 160 |
| Alternative 8 | |
|---|---|
| Accuracy | 8.2% |
| Cost | 96 |
herbie shell --seed 2023129
(FPCore (s u)
:name "Disney BSSRDF, sample scattering profile, lower"
:precision binary32
:pre (and (and (<= 0.0 s) (<= s 256.0)) (and (<= 2.328306437e-10 u) (<= u 0.25)))
(* s (log (/ 1.0 (- 1.0 (* 4.0 u))))))