(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
:precision binary32
(exp
(+
(+
(-
(- (/ (* cosTheta_i cosTheta_O) v) (/ (* sinTheta_i sinTheta_O) v))
(/ 1.0 v))
0.6931)
(log (/ 1.0 (* 2.0 v))))))(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
:precision binary32
(let* ((t_0
(+
(/ (- (* cosTheta_i cosTheta_O) (* sinTheta_i sinTheta_O)) v)
(+ 0.6931 (/ -1.0 v))))
(t_1 (log (/ 0.5 v))))
(exp (/ (- (pow t_0 2.0) (* t_1 t_1)) (- t_0 t_1)))))float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
return expf(((((((cosTheta_i * cosTheta_O) / v) - ((sinTheta_i * sinTheta_O) / v)) - (1.0f / v)) + 0.6931f) + logf((1.0f / (2.0f * v)))));
}
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
float t_0 = (((cosTheta_i * cosTheta_O) - (sinTheta_i * sinTheta_O)) / v) + (0.6931f + (-1.0f / v));
float t_1 = logf((0.5f / v));
return expf(((powf(t_0, 2.0f) - (t_1 * t_1)) / (t_0 - t_1)));
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
real(4), intent (in) :: costheta_i
real(4), intent (in) :: costheta_o
real(4), intent (in) :: sintheta_i
real(4), intent (in) :: sintheta_o
real(4), intent (in) :: v
code = exp(((((((costheta_i * costheta_o) / v) - ((sintheta_i * sintheta_o) / v)) - (1.0e0 / v)) + 0.6931e0) + log((1.0e0 / (2.0e0 * v)))))
end function
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
real(4), intent (in) :: costheta_i
real(4), intent (in) :: costheta_o
real(4), intent (in) :: sintheta_i
real(4), intent (in) :: sintheta_o
real(4), intent (in) :: v
real(4) :: t_0
real(4) :: t_1
t_0 = (((costheta_i * costheta_o) - (sintheta_i * sintheta_o)) / v) + (0.6931e0 + ((-1.0e0) / v))
t_1 = log((0.5e0 / v))
code = exp((((t_0 ** 2.0e0) - (t_1 * t_1)) / (t_0 - t_1)))
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v) return exp(Float32(Float32(Float32(Float32(Float32(Float32(cosTheta_i * cosTheta_O) / v) - Float32(Float32(sinTheta_i * sinTheta_O) / v)) - Float32(Float32(1.0) / v)) + Float32(0.6931)) + log(Float32(Float32(1.0) / Float32(Float32(2.0) * v))))) end
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v) t_0 = Float32(Float32(Float32(Float32(cosTheta_i * cosTheta_O) - Float32(sinTheta_i * sinTheta_O)) / v) + Float32(Float32(0.6931) + Float32(Float32(-1.0) / v))) t_1 = log(Float32(Float32(0.5) / v)) return exp(Float32(Float32((t_0 ^ Float32(2.0)) - Float32(t_1 * t_1)) / Float32(t_0 - t_1))) end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v) tmp = exp(((((((cosTheta_i * cosTheta_O) / v) - ((sinTheta_i * sinTheta_O) / v)) - (single(1.0) / v)) + single(0.6931)) + log((single(1.0) / (single(2.0) * v))))); end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v) t_0 = (((cosTheta_i * cosTheta_O) - (sinTheta_i * sinTheta_O)) / v) + (single(0.6931) + (single(-1.0) / v)); t_1 = log((single(0.5) / v)); tmp = exp((((t_0 ^ single(2.0)) - (t_1 * t_1)) / (t_0 - t_1))); end
e^{\left(\left(\left(\frac{cosTheta_i \cdot cosTheta_O}{v} - \frac{sinTheta_i \cdot sinTheta_O}{v}\right) - \frac{1}{v}\right) + 0.6931\right) + \log \left(\frac{1}{2 \cdot v}\right)}
\begin{array}{l}
t_0 := \frac{cosTheta_i \cdot cosTheta_O - sinTheta_i \cdot sinTheta_O}{v} + \left(0.6931 + \frac{-1}{v}\right)\\
t_1 := \log \left(\frac{0.5}{v}\right)\\
e^{\frac{{t_0}^{2} - t_1 \cdot t_1}{t_0 - t_1}}
\end{array}



Bits error versus cosTheta_i



Bits error versus cosTheta_O



Bits error versus sinTheta_i



Bits error versus sinTheta_O



Bits error versus v
Results
Initial program 0.1
Applied egg-rr0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022165
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
:name "HairBSDF, Mp, lower"
:precision binary32
:pre (and (and (and (and (and (<= -1.0 cosTheta_i) (<= cosTheta_i 1.0)) (and (<= -1.0 cosTheta_O) (<= cosTheta_O 1.0))) (and (<= -1.0 sinTheta_i) (<= sinTheta_i 1.0))) (and (<= -1.0 sinTheta_O) (<= sinTheta_O 1.0))) (and (<= -1.5707964 v) (<= v 0.1)))
(exp (+ (+ (- (- (/ (* cosTheta_i cosTheta_O) v) (/ (* sinTheta_i sinTheta_O) v)) (/ 1.0 v)) 0.6931) (log (/ 1.0 (* 2.0 v))))))