?

Average Error: 12.2 → 0.2
Time: 13.0s
Precision: binary32
Cost: 9792

?

\[\left(0 \leq s \land s \leq 256\right) \land \left(2.328306437 \cdot 10^{-10} \leq u \land u \leq 0.25\right)\]
\[s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right) \]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(u \cdot -4\right) \cdot \left(-s\right)\right)\right) \]
(FPCore (s u) :precision binary32 (* s (log (/ 1.0 (- 1.0 (* 4.0 u))))))
(FPCore (s u) :precision binary32 (log1p (expm1 (* (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(expm1f((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 log1p(expm1(Float32(log1p(Float32(u * Float32(-4.0))) * Float32(-s))))
end
s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right)
\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(u \cdot -4\right) \cdot \left(-s\right)\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 12.2

    \[s \cdot \log \left(\frac{1}{1 - 4 \cdot u}\right) \]
  2. Applied egg-rr0.2

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\left(-\mathsf{log1p}\left(u \cdot -4\right)\right) \cdot s\right)\right)} \]
  3. Final simplification0.2

    \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(u \cdot -4\right) \cdot \left(-s\right)\right)\right) \]

Alternatives

Alternative 1
Error0.2
Cost3392
\[\mathsf{log1p}\left(u \cdot -4\right) \cdot \left(-s\right) \]
Alternative 2
Error2.9
Cost416
\[s \cdot \left(u \cdot \left(4 - u \cdot \left(u \cdot -21.333333333333332 + -8\right)\right)\right) \]
Alternative 3
Error4.2
Cost352
\[s \cdot \left(8 \cdot \left(u \cdot u\right) + u \cdot 4\right) \]
Alternative 4
Error4.3
Cost288
\[s \cdot \left(u \cdot \left(4 + u \cdot 8\right)\right) \]
Alternative 5
Error8.5
Cost160
\[4 \cdot \left(u \cdot s\right) \]
Alternative 6
Error8.4
Cost160
\[u \cdot \left(s \cdot 4\right) \]

Error

Reproduce?

herbie shell --seed 2023083 
(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))))))