| Alternative 1 | |
|---|---|
| Error | 1.4 |
| Cost | 3616 |
\[3 \cdot \left(s \cdot \log \left(\frac{1}{1 - 1.3333333333333333 \cdot \left(u - 0.25\right)}\right)\right)
\]
(FPCore (s u) :precision binary32 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
(FPCore (s u) :precision binary32 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
float code(float s, float u) {
return (3.0f * s) * logf((1.0f / (1.0f - ((u - 0.25f) / 0.75f))));
}
float code(float s, float u) {
return (3.0f * s) * logf((1.0f / (1.0f - ((u - 0.25f) / 0.75f))));
}
real(4) function code(s, u)
real(4), intent (in) :: s
real(4), intent (in) :: u
code = (3.0e0 * s) * log((1.0e0 / (1.0e0 - ((u - 0.25e0) / 0.75e0))))
end function
real(4) function code(s, u)
real(4), intent (in) :: s
real(4), intent (in) :: u
code = (3.0e0 * s) * log((1.0e0 / (1.0e0 - ((u - 0.25e0) / 0.75e0))))
end function
function code(s, u) return Float32(Float32(Float32(3.0) * s) * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(u - Float32(0.25)) / Float32(0.75)))))) end
function code(s, u) return Float32(Float32(Float32(3.0) * s) * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(u - Float32(0.25)) / Float32(0.75)))))) end
function tmp = code(s, u) tmp = (single(3.0) * s) * log((single(1.0) / (single(1.0) - ((u - single(0.25)) / single(0.75))))); end
function tmp = code(s, u) tmp = (single(3.0) * s) * log((single(1.0) / (single(1.0) - ((u - single(0.25)) / single(0.75))))); end
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
Results
Initial program 1.3
Final simplification1.3
| Alternative 1 | |
|---|---|
| Error | 1.4 |
| Cost | 3616 |
| Alternative 2 | |
|---|---|
| Error | 1.3 |
| Cost | 3616 |
| Alternative 3 | |
|---|---|
| Error | 1.5 |
| Cost | 3552 |
| Alternative 4 | |
|---|---|
| Error | 1.4 |
| Cost | 3552 |
| Alternative 5 | |
|---|---|
| Error | 22.4 |
| Cost | 352 |
| Alternative 6 | |
|---|---|
| Error | 22.4 |
| Cost | 224 |
| Alternative 7 | |
|---|---|
| Error | 22.4 |
| Cost | 160 |
| Alternative 8 | |
|---|---|
| Error | 22.4 |
| Cost | 160 |
herbie shell --seed 2023075
(FPCore (s u)
:name "Disney BSSRDF, sample scattering profile, upper"
:precision binary32
:pre (and (and (<= 0.0 s) (<= s 256.0)) (and (<= 0.25 u) (<= u 1.0)))
(* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))